Support » Plugin: WooCommerce Menu Cart » Change currency format

  • Resolved Dean Loh

    (@dean-loh)


    In Singapore, the official currency symbol is SGD, hence the menu cart icon is showing SGD. But client is being difficult, asking to change it to S$.

    Where do I go to change that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ewout

    (@pomegranate)

    Hi! The plugin uses the WooCommere settings for this. The easiest (and probably best) solution for this is to fix this at the base WooCommerce level.
    What’s interesting is that WooCommerce actually uses the $ sign already for SGD:

    This means that if you’re seeing ‘SGD’ on the frontend rather than $, something is filtering the symbol already (your theme, a plugin or a custom filter).

    That said, you can override the symbol in WooCommerce with the following filter:

    
    add_filter( 'woocommerce_currency_symbol', 'woocommerce_currency_symbol_sgd', 1001, 2 );
    function woocommerce_currency_symbol_sgd( $currency_symbol, $currency ) {
    	if ($currency == 'SGD') {
    		$currency_symbol = 'S$';
    	}
    	return $currency_symbol;
    }
    

    Hope that helps!

    Thread Starter Dean Loh

    (@dean-loh)

    Thank you @pomegranate!

    I had actually applied the same filter for changing the symbol, but I forgot to clear my server cache in order to see the new symbol.

    All is good now! Thank you for responding to my question.

    Plugin Author Ewout

    (@pomegranate)

    Very glad to hear that, good luck with the site!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change currency format’ is closed to new replies.