gabrielfuentes

Personalize WooCommerce Currency

Jul 6th, 2021 (edited)
54
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
  2.  
  3. function add_my_currency_symbol( $currency_symbol, $currency ) {
  4.      switch( $currency ) {
  5.         //Modifying Jamaican JMD to JMD $ in this case.
  6.           case 'JMD': $currency_symbol = 'JMD $'; break;
  7.      }
  8.      return $currency_symbol;
  9. }
RAW Paste Data