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

Multi currency setup with Phone Order

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,

I'm using Phone Order by Algolplus and I want to make it work with WOOCS (paying version).

I want the Phone order page (creation of the order) to be in the default currency (EUR), but checkout to be automatically in USD.

I followed https://currency-switcher.com/force-currency-on-checkout-page/ but it doesn't seem to work. It doesn't switch automatically to USD. Allow multiple is set to yes and the code has been added to functions.php as recommended.

Any suggestion ?

Hello

I did  test - https://c2n.me/49BFFxO - It looks like everything is working correctly.

Or am I doing something wrong?

I understand better.

It's working, but not in my use case.

I'm using the plugin Woocommerce Phone Orders to create the order and pay it as the customer (the customer is on the hone and pays over the phone).

Hence, I'm going from :

/wp-admin/admin.php?page=phone-orders-for-woocommerce#add-order

to

/checkout/order-pay/45/?pay_for_order=true&key=wc_order_i74nptOEoHTHO

without going to /checkout/

I don't know if it makes sense.

Here is a video to show the steps :

https://drive.google.com/file/d/13MeAvUUwFFRFtV8el5ze9FlXVDYrrb73/view?usp=sharing

Hello

Ok! In this case, this code will not work  - https://c2n.me/49CvHvG.png

you need code customization

Try  to  add  is_wc_endpoint_url( 'order-pay' )

Example:

if(is_checkout() OR is_wc_endpoint_url( 'order-pay' )){

Doesn't seem to wok :(

 

Is there a problem because the url is /checkout/order-pay/57/?pay_for_order=true&key=wc_order_wIFTEXxIVXgpn and not simply /checkout/order-pay ?

Hello

Ok!  try  to  add

if(isset($_GET['pay_for_order']) || is_checkout() )  {

Thanks, I tried :

/**
* Adaptation for WOOCS and Phone orders
*/
add_action("wpo_before_update_cart", function($cart_data) {
global $WOOCS;
$WOOCS->set_currency('USD');
});
add_filter('wp_loaded',function(){
if(is_checkout() OR is_wc_endpoint_url( 'order-pay' )){
global $WOOCS;
$WOOCS->set_currency('CAD');
}
});

 

and

 

/**
* Adaptation for WOOCS and Phone orders
*/
add_action("wpo_before_update_cart", function($cart_data) {
global $WOOCS;
$WOOCS->set_currency('USD');
});
add_filter('wp_loaded',function(){
if(isset($_GET['pay_for_order']) || is_checkout() )  {

global $WOOCS;
$WOOCS->set_currency('CAD');
}
});

 

 

I have the same behavior for both codes, it seems to work only if Allow Multiple is set to no, but the currency is still displayed as USD eventhough it did the value conversion to CAD ...

Here is a screencast of the behavior.

https://drive.google.com/file/d/1PMhTNDJ5CTbvgHp77mdRv9cZAUlRc8jw/view?usp=sharing

The screencast was done with this code

/**
* Adaptation for WOOCS and Phone orders
*/
add_action("wpo_before_update_cart", function($cart_data) {
global $WOOCS;
$WOOCS->set_currency('USD');
});
add_filter('wp_head',function(){
if(isset($_GET['pay_for_order']) || is_checkout() ) {
global $WOOCS;
$WOOCS->set_currency('CAD');
}
});

Thanks for all your help

Hello

You created an order in USD.  When you go to the checkout page for this order, the order currency should be displayed and this is good behavior

https://c2n.me/49QXHWC.png - this is the order data displayed (not the product)  If you change the currency on this page then the amount will be displayed the same, the difference will be only in the currency sign.  Because this is an order and it has already been created in the database.

For the order to be in a different currency, you need to recalculate all the order amounts (taxes, discounts, coupons, total amount, etc.) and overwrite this in the database. And it's very important to change the metadata  _order_currency

Indeed.

That's exactly what I want, I just don't know how to achieve it.

I want the order to be prepared in USD and then recalculated in CAD (taxes, discounts, coupons, total amount, etc.) and overwrite it in the database.

So far I can't manage to do it properly :(

Hello

what is your base currency?

Is it ok to change the order currency on the orders page (after payment)?

I think you need to look for hooks on the side of Phone Order by Algolplus