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

Currency based on shipping address

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, How do I make the site show the currency symbol automatically based on the customers shipping address? I tried a code I found previously but it only allowed Canada to show no mater what the shipping address was.

This code:

add_action('woocommerce_checkout_update_order_review', function($data) { global $WOOCS; if (is_string($data)) { parse_str($data, $data); } //*** $_currency = $WOOCS->get_currency_by_country($data['shipping_country']); if (!empty($_currency)) { $WOOCS->set_currency($_currency); } }, 9999);

Hello

Please try to use this code

add_action('woocommerce_checkout_update_order_review', function($data) {

global $WOOCS;

if (is_string($data)) {

parse_str($data, $data);

} //***

$_currency = $WOOCS->get_currency_by_country($data['billing_country']);

if (!empty($_currency)) {

$WOOCS->set_currency($_currency);

} }, 9999);

  1. It seems to work, but I notice if a user in the USA logs back into their account they see the Canada and USA symbols on the product pages, not until they get to the checkout page it will reset back to USA only.  Is there any way to avoid this?  I have a video of this example if needed.
  2. Also is there a way to make it read the shipping/billing address before hitting the checkout page? The new user has to get to the checkout page before they see the currency symbol change.  I want it to change for them before the checkout page.

 

Hello

1 Please drop me the video

2 Unfortunately we don't have such a solution, you need to customize the plugin

Hi Here is the video,

Video link of issue:
https://uristregenmed-my.sharepoint.com/:v:/g/personal/blanca_avila_inducebiologics_com/ET4gCdiHentOtN2yrEoIeqUBMogtcXy9iLcxsweFjRghug?e=WprPSC

I was thinking if I have to set the whole store to a default currency on the woocommerce side, then the CAN users once they hit the checkout page they will see C$? would that be the only way?

Hello

I watched the video. Yes, it works correctly. When the user goes to the checkout page, this custom code switches the currency.

You have two currencies on your site. And these currencies are available on your site and the current currency depends on what the user chooses. And the currency is stored for each user. In your case, the custom code switches the currency.