currency cant get changed and keep switch back to arabic symbol
-
/**
* Force MAD currency symbol to ‘DH’ and prevent translation overrides
*/
add_filter(‘woocommerce_currency_symbol’, ‘force_mad_currency_symbol’, 99999, 2);
function force_mad_currency_symbol( $currency_symbol, $currency ) {
if ( ‘MAD’ === $currency ) {
// We return the string directly to bypass translation files
return ‘DH’;
}
return $currency_symbol;
}
// Ensure the symbol list is also updated for the backend/settings
add_filter(‘woocommerce_currency_symbols’, ‘update_mad_symbols_list’, 99999);
function update_mad_symbols_list( $symbols ) {
$symbols[‘MAD’] = ‘DH’;
return $symbols;
}
Hello,
Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand if it is our theme issue or not?
Best Regards,