• Resolved LeonN1960

    (@leonn1960)


    Hi,
    I made a wordpress website for the peruvian market, with woocommerce.
    Now I want to configure the peruvian nuevo sol as its base currency, also with the correct symbol.
    I also use the ‘all currencies for woocommerce’ plugin and as a result I can choose the PEN as currency. But still the ‘$’ symbol is indicated as the currency symbol. The way to change is indicated as to use ‘all currencies for woocommerce PRO’, but I could not find this plugin.
    In forums I see solutions to change the function.php, but thats not a preferable solution.

    Any ideas?

    https://www.ads-software.com/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi LeonN1960,

    WooCommerce by default provides limited currency options. However it does provide a way to add custom currency option. WooCommerce official documentation suggests to place a custom currency code in theme’s functions.php file. So rest assured that, there is no harm in placing that code in theme’s functions.php file.

    In your case, please find the following code which you can use and change if needed.

    add_filter( 'woocommerce_currencies', 'add_peruvian_nuevo_sol_currency' );
    
    function add_peruvian_nuevo_sol_currency( $currencies ) {
         $currencies['perusol'] = __( 'Peruvian Sol', 'woocommerce' );
         return $currencies;
    }
    
    add_filter('woocommerce_currency_symbol', 'add_peruvian_sol_currency_symbol', 10, 2);
    
    function add_peruvian_sol_currency_symbol( $currency_symbol, $currency ) {
         switch( $currency ) {
              case 'perusol': $currency_symbol = 'S/ '; break;
         }
         return $currency_symbol;
    }

    Once you place this code in your theme’s functions.php file, from WooCommerce > Settings menu you can choose the newly added currency from Currency dropdown. I hope this helps. Let us know how it goes.

    Thread Starter LeonN1960

    (@leonn1960)

    Thanks, I will implement this one

    Great. Please let us know if you need any further assistance or else you may mark it as resolved.

    Thread Starter LeonN1960

    (@leonn1960)

    Works great!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Currency symbol’ is closed to new replies.