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 on Checkout not working

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.

Hi there,

I want to force currency to ZAR on checkout as no other currency is supported in my PayGate.

I have"Is Multiple Allowed" set to yes

I have the code added to my child theme (I use child) functions.php

add_filter('wp_head',function(){    
    if(is_checkout()){
        global $WOOCS;
        $WOOCS->set_currency('ZAR');
    }
});

The price still shows as USD on checkout:

https://prnt.sc/1uvessy

Hello

I checked your site.

I cannot switch to USD on the checkout page - https://share.pluginus.net/video/v20211005132300.mp4

And  please  disable  this  option - https://c2n.me/4dysDNW.png - It doesn't make sense with this code

I disabled the GEOIP option... cleared cache but still having problems

 

Sorry for sounding like a total noob, this is really messing with my brain. I do not understand how to achieve the following.

I want two different prices:
1. One price in ZAR for people in South Africa
2. One prince in USD for people outside South Africa

I also want to people to see the currency applied already. So people visiting from South Africa see the ZAR currency and price, and people outside see the USD currency and price.

Then I want the USD to convert  to ZAR on checkout because my paygate only accepts ZAR.

I have defined two prices on the product.

Can you please help me? What am I doing wrong?

Hello

Please  watch a  video - https://currency-switcher.com/video#video_1

Add  this  code:

add_filter('wp_head',function(){
if(is_checkout()){
global $WOOCS;
$WOOCS->set_currency('ZAR');

} else{
global $WOOCS;
$customer_country = $this->storage->get_val('woocs_user_country');
$currency = $WOOCS->get_currency_by_country($customer_country);
$WOOCS->set_currency($currency);
}

});

Delete  this - https://share.pluginus.net/image/i20211006104559.png

Something wrong with the new code, cause I get this error when I add it:
It works on the checkout page, but there is a problem. The code simply switches to ZAR price. The problem is, I have a different price for South Africa ZAR and United States USD
Example:
(I charge $10 for South Africa and $20 for the United States)
USD Price is $20.00 (+- ZAR R300)
South African price is ZAR R150 (which is $10.00)
On the checkout page, the code does not convert the USD $20.00 to ZAR R300, it simply switches to ZAR R150.
So basically the USD price gets ignored, and it simply takes the ZAR price on checkout.
How can I 'do the conversion' on the checkout page?

Hello

Please  use  this  code:

add_filter('wp_head',function(){
if(is_checkout()){
global $WOOCS;
$WOOCS->set_currency('ZAR');

} else{
global $WOOCS;
$customer_country = $WOOCS->storage->get_val('woocs_user_country');
$currency = $WOOCS->get_currency_by_country($customer_country);
$WOOCS->set_currency($currency);
}

});