Support Forum

Content of the article

WPBE - WordPress Posts Bulk Editor Professional
You need to log-in to create request (topic) to the support

Multi Language site

(new from 01-07-2019)
If you not got email within 24 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here.
The support doesn work on saturdays and sundays, so some Friday requests can be answered on Monday.

Hi there,

I have a multi language website using WPML plugin. Arabic and English. Whatever currency sign I use gets displayed on both the Arabic version and the English version which is not the desired outcome.

I used to use this code in the child theme functions.php:

#English Currency for English Site and Arabic Currency for Arabic site
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);

function change_existing_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'SAR':
if(ICL_LANGUAGE_CODE=='ar'){
$currency_symbol = 'ر.س';
}else{
$currency_symbol = 'SAR';
}
break;
}
return $currency_symbol;
}

 

However, once I activate your plugin, this code seems to be overwritten by your plugin for one reason on another.

Is there anyway around this ?

 

P.S: I bought the pro version from codecanyon and I am not sure where to find this "purchase code"

Hello

To get  "purchase code" - https://c2n.me/43Mtl52.jpg

Try  to  change this  line:

add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 9999999, 2);

Hi,

I tried adding the line code as u suggested but it didn't do anything.

I have added the purchase code to the private data section as well as a link to our staging site where the issue can be seen. In the English version of the site, when the page first loads, the correct currency symbol "SAR" is displayed for a second and then it changes back to ر.س.

One more thing, the problem disappears once the multi currency plugin is disabled.

I would appreciate it if you can take a look at this.

Regards,

Hello

Try  this  code:

add_filter('woocs_currency_data_manipulation', 'woocs_currency_data_manipulation', 1, 1);
function woocs_currency_data_manipulation($currencies)
{
    if(isset($currencies['SAR'])){
if(ICL_LANGUAGE_CODE=='ar'){
$currencies['SAR']['symbol'] = 'ر.س';
}else{
$currencies['SAR']['symbol']  = 'SAR';
}
    }
    return $currencies;
}

Hi,

 

Thank you for your reply. However, I added this code to my child theme's functions.php and it didn't change anything.

 

Any other ways to handle this ?

 

Regards,