Replies: 0
Hi
Hello I want to use your plugin which has it great and I use Translatepress and Elementor
I found the following code in a discussion, to change the currency depending on the language and I add it to fubction.php, indeed the currency has changed but I can no longer modify my website with Elementor
$lang=get_locale();
global $WOOCS;
switch($lang){
case 'en_US':
$WOOCS->current_currency='USD';
$WOOCS->storage->set_val('woocs_current_currency', 'USD');
break;
case 'fr_FR':
$WOOCS->current_currency='EUR';
$WOOCS->storage->set_val('woocs_current_currency', 'EUR');
break;
default:
$WOOCS->current_currency='EUR';
$WOOCS->storage->set_val('woocs_current_currency', 'EUR');
break;
}
I then integrated this code in order to connect Elementor
Résult :
if(class_exists(‘WOOCS’)){
//$lang = isset($_SERVER[‘HTTP_X_GT_LANG’]) ? $_SERVER[‘HTTP_X_GT_LANG’] : ”;
switch ($lang)
{
case ‘en_GB’:
alg_wc_cs_session_set( ‘alg_currency’, EUR );
break;
default:
alg_wc_cs_session_set( ‘alg_currency’, USD );
break;
}
But my site is now showing a critical error can you please help me by giving me the correct code
My original language French and my currency: Euro> I want to be able to change it and use the currency USD and the English language en_US
Thank you in avance,
Alex