Adding New Currency
-
In case you want to add a currency which is missing in the plugin.
Insert the following code in your theme’s function.php file, then change ABC to your currency symbol and Currency name to the name of your currency:
add_filter( ‘wps_deals_currency_data’, ‘add_my_currency’ );
function add_my_currency( $currencies ) {
$currencies[‘ABC’] = __( ‘Currency name’, ‘wps_deals’ );
return $currencies;
}add_filter(‘wps_deals_currency_data’, ‘add_my_currency_symbol’, 10, 2);
function add_my_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case ‘ABC’: $currency_symbol = ‘$’; break;
}
return $currency_symbol;
}
- The topic ‘Adding New Currency’ is closed to new replies.