PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Force currency at a user level

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello, we are forcing all users to checkout in the welcome currency (GBP) but still allow customers to browse in their local currency. We now need to allow a specific user to checkout in EUR and bypass the welcome currency. How can we achieve this ? I was looking at some of the code snippets on your support site but couldn’t find one relevant I don’t think. Thanks!

Hello

how do you want to define this user

The custom code depends on it.

for example if you know the user ID:

add_filter('wp_head',function(){
if(is_checkout()){

if (class_exists('WOOCS')) {
global $WOOCS;

if(get_current_user_id() == 22  && ($WOOCS->current_currency == 'USD' || $WOOCS->current_currency == 'EUR') ){

return;

}

$WOOCS->set_currency('EUR');

}
}
});

Hello, thank you so much for this!

Do you know if this code will still bypass the checkout welcome currency thats being forced on all users ?

I have added to my basket and can see its in GBP when logged in as the set user using the user ID.

I expanded on the code you provided to include GBP, assuming this is correct ?

 

 

add_filter('wp_head',function(){
if(is_checkout()){

if (class_exists('WOOCS')) {
global $WOOCS;

if(get_current_user_id() == 66 && ($WOOCS->current_currency == 'GBP' || $WOOCS->current_currency == 'EUR' || $WOOCS->current_currency == 'USD') ){

return;

}

$WOOCS->set_currency('EUR');

}
}
});

Hello, I have tested the above and it still forces GBP at checkout and the order screen shows as GBP too.

Hello

 we are forcing all users to checkout in the welcome currency (GBP)  - What are you using for this behavior?

Hello, your plugin does this by default ? The"Allow Multiple" is not enabled so the welcome currency is used at checkout, regardless of what currency they were browsing in ?

 

Hello

Ok!  Please enable   "Allow Multiple"

And  add  this  code:

add_filter('wp_head',function(){
if(is_checkout()){

if (class_exists('WOOCS')) {
global $WOOCS;

if(get_current_user_id() == 22  && ($WOOCS->current_currency == 'GBP' || $WOOCS->current_currency == 'EUR') ){

return;

}

$WOOCS->set_currency('GBP');

}
}
});

 

Hello, If I enable"Allow Multiple" then all my customers will then be able to checkout in whatever currency they select ?

I only need ONE customer to be able to checkout in a set currency that we give.

 

Hello

Ok!  Great!  This code makes it switch the currency to GBP for all users, except for one

If you have more than two currencies:

add_filter('wp_head',function(){
if(is_checkout()){

if (class_exists('WOOCS')) {
global $WOOCS;

if(get_current_user_id() == 22){

return;

}

$WOOCS->set_currency('GBP');

}
}
});

Hello, I have tested this code and it does not work.

I have added it via the"Snippets" plugin and when logged in as this user the checkout is still forced to GBP.

If I try to change the currency via the switcher it just reverts to GBP.

Hello

So you did something wrong

this code only works on the checkout page

Drop  me  exact  link to the  issue and  wp-admin  access - https://c2n.me/43SC6rb.png ->https://c2n.me/42BAoj4.png