PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, February 10, 2022

[FIXED] Change currency symbol in WooCommerce emails notifications

 February 10, 2022     email-notifications, php, woocommerce, wordpress     No comments   

Issue

I am struggeling by changing the currency symbol in WooCommerce email notifications.

Everywhere you can see the € currency, but as far as you open the emails, you find, that the currency there is £.

I tried to add this function using Snipets:

/**
* change currency symbol to €
*/

add_filter( 'woocommerce_currency_symbol', 'wc_change_uae_currency_symbol', 10, 2 );

function wc_change_uae_currency_symbol( $currency_symbol, $currency ) {
switch ( $currency ) {
case '€':
$currency_symbol = '€';
break;
}

return $currency_symbol;
}

But nothing has changed. Any advice?


Here is a simple image for that also describe the situation:

enter image description here


Solution

This should fix the issue:

function filter_woocommerce_currency_symbol( $currency_symbol, $currency ) {    
    // Compare
    switch( $currency ) {
        case 'GBP': $currency_symbol = '€';
        break;
    }
    
    return $currency_symbol;
}
add_filter( 'woocommerce_currency_symbol', 'filter_woocommerce_currency_symbol', 1, 2 );

The difference is that you are currently converting € symbol into the € symbol


Tested in WordPress 5.8.3 and WooCommerce 6.0.0



Answered By - 7uc1f3r
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing