Currency conversion wrong on cart page
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 pleaseIf 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.
Quote from ajitmohun on March 22, 2021, 03:01Hello,
I just bought the premium plugin yesterday, my Basic currency is MUR and I have 2 additional currencies: USD & EUR.
After adding a product to cart, the converted currency displayed on the cart page is wrong for both USD & EUR (See below screenshot on the provided link)
https://tamarindleafyoga.com/wp-content/uploads/2021/03/screenshot_20210322.png
The product is I am testing is the following: https://tamarindleafyoga.com/product/starter-plan/
After some internet search, I tried to add the code snippet below but in vain, the issue is still present.
//We are reversing the price of product to MUR in cart page, because the rate is applied again there
add_action('woocommerce_before_calculate_totals', 'fix_currency_conversion');
function fix_currency_conversion($cart_object){
global $WOOCS;
$cur_currency = $WOOCS->current_currency;
$currencies = $WOOCS->get_currencies();
$conversion_rate = $currencies[$WOOCS->current_currency]['rate'];
if($cur_currency == 'USD'){
foreach ( $cart_object->cart_contents as $cart_item_key => $cart_item ) {
$cart_item['data']->set_price($cart_item['data']->price / $conversion_rate);
}
}
}
Sources:
https://wordpress.org/support/topic/currency-conversion-is-wrong-in-cart-page/
https://stackoverflow.com/questions/60641547/currency-conversion-by-plugin-is-wrong-in-cart-page
Can you please advise?
Thanks and regards,
Ajit M.
Hello,
I just bought the premium plugin yesterday, my Basic currency is MUR and I have 2 additional currencies: USD & EUR.
After adding a product to cart, the converted currency displayed on the cart page is wrong for both USD & EUR (See below screenshot on the provided link)
https://tamarindleafyoga.com/wp-content/uploads/2021/03/screenshot_20210322.png
The product is I am testing is the following: https://tamarindleafyoga.com/product/starter-plan/
After some internet search, I tried to add the code snippet below but in vain, the issue is still present.
//We are reversing the price of product to MUR in cart page, because the rate is applied again there
add_action('woocommerce_before_calculate_totals', 'fix_currency_conversion');
function fix_currency_conversion($cart_object){
global $WOOCS;
$cur_currency = $WOOCS->current_currency;
$currencies = $WOOCS->get_currencies();
$conversion_rate = $currencies[$WOOCS->current_currency]['rate'];
if($cur_currency == 'USD'){
foreach ( $cart_object->cart_contents as $cart_item_key => $cart_item ) {
$cart_item['data']->set_price($cart_item['data']->price / $conversion_rate);
}
}
}
Sources:
https://wordpress.org/support/topic/currency-conversion-is-wrong-in-cart-page/
https://stackoverflow.com/questions/60641547/currency-conversion-by-plugin-is-wrong-in-cart-page
Can you please advise?
Thanks and regards,
Ajit M.
Quote from Pablo Borysenco on March 22, 2021, 13:07Hello Ajit
This is an incompatibility with a third party plugin( in your case a subscription plugin )
Read this please - https://currency-switcher.com/woocs-labs/
Hello Ajit
This is an incompatibility with a third party plugin( in your case a subscription plugin )
Read this please - https://currency-switcher.com/woocs-labs/
Quote from ajitmohun on March 22, 2021, 23:18Hi Pablo,
Thank you for your reply. I am indeed using the YITH WooCommerce Subscription plugin and unfortunately there is currently no fix available for it on the link you provided. The followings are the only YITH plugin fixes available.
- YITH Donations for WooCommerce Premium 1.0.14
- YITH WooCommerce Account Funds
- YITH WooCommerce Color and Label Variations
- YITH WooCommerce Deposits and Down Payments
- YITH WooCommerce Dynamic Pricing and Discounts
- YITH WooCommerce Name Your Price Premium
- YITH Woocommerce Points and Rewards
- YITH WooCommerce Product Add-Ons
- YITH WooCommerce Role Based Prices
[WOOCS LABS]
Can you please consider a request to create an adaptation script for the YITH WooCommerce Subscription plugin?
This plugin is vital for me and I don't have any other way around it.
Thanks and regards,
Ajit M.
Hi Pablo,
Thank you for your reply. I am indeed using the YITH WooCommerce Subscription plugin and unfortunately there is currently no fix available for it on the link you provided. The followings are the only YITH plugin fixes available.
- YITH Donations for WooCommerce Premium 1.0.14
- YITH WooCommerce Account Funds
- YITH WooCommerce Color and Label Variations
- YITH WooCommerce Deposits and Down Payments
- YITH WooCommerce Dynamic Pricing and Discounts
- YITH WooCommerce Name Your Price Premium
- YITH Woocommerce Points and Rewards
- YITH WooCommerce Product Add-Ons
- YITH WooCommerce Role Based Prices
[WOOCS LABS]
Can you please consider a request to create an adaptation script for the YITH WooCommerce Subscription plugin?
This plugin is vital for me and I don't have any other way around it.
Thanks and regards,
Ajit M.
Quote from Pablo Borysenco on March 23, 2021, 11:56Hello Ajit
Sure! Please add wp-admin +FTP access to your test site - https://c2n.me/43SC6rb.png -> https://c2n.me/42BAoj4.png
I'll add this to the adaptation queue
Hello Ajit
Sure! Please add wp-admin +FTP access to your test site - https://c2n.me/43SC6rb.png -> https://c2n.me/42BAoj4.png
I'll add this to the adaptation queue
Quote from ajitmohun on March 23, 2021, 13:02Hi Pablo,
The credentials requested have been added to the private area.
Thanks,
Ajit M.
Hi Pablo,
The credentials requested have been added to the private area.
Thanks,
Ajit M.
Quote from Pablo Borysenco on March 24, 2021, 10:47Hello Ajit
If the site alive - create clone of it by https://wordpress.org/plugins/duplicator/ and send me access
Hello Ajit
If the site alive - create clone of it by https://wordpress.org/plugins/duplicator/ and send me access
Quote from ajitmohun on March 24, 2021, 11:16Hi Pablo,
I am on a business plan with wordpress.com and hence don’t have hosting space to host a clone.
Even though my site is live, it does not have lots of traffic and wordpress.com does full backup of the site daily, which can be easily rollbacked to if needed.
Please proceed with the adaptation script and while testing, a 5-10 minutes outage is fine provided you quickly rollback the change if you run into issues.
Thank you
Ajit M.
Hi Pablo,
I am on a business plan with wordpress.com and hence don’t have hosting space to host a clone.
Even though my site is live, it does not have lots of traffic and wordpress.com does full backup of the site daily, which can be easily rollbacked to if needed.
Please proceed with the adaptation script and while testing, a 5-10 minutes outage is fine provided you quickly rollback the change if you run into issues.
Thank you
Ajit M.
Quote from Pablo Borysenco on March 24, 2021, 13:17Ok! the problem is that when we do the adaptation, debug information and short server crashes may be output
Ok! the problem is that when we do the adaptation, debug information and short server crashes may be output
Quote from ajitmohun on March 24, 2021, 13:22In that case, please feel free to activate the maintenance page on the site if that helps. There is a maintenance page plugin already installed.
Thanks,
Ajit M.
In that case, please feel free to activate the maintenance page on the site if that helps. There is a maintenance page plugin already installed.
Thanks,
Ajit M.
Quote from Pablo Borysenco on March 25, 2021, 11:59Hello
ok! I will write to you as soon as we get the result
Hello
ok! I will write to you as soon as we get the result
Quote from ajitmohun on March 29, 2021, 20:54Hi Pablo,
Do you have any update on the adaptation script?
Thank you
Ajit M.
Hi Pablo,
Do you have any update on the adaptation script?
Thank you
Ajit M.
Quote from Pablo Borysenco on March 30, 2021, 10:39Hello Ajit
I will write to you when the result is.
as I wrote above, this is a queue for adaptation
Hello Ajit
I will write to you when the result is.
as I wrote above, this is a queue for adaptation
Quote from ajitmohun on April 5, 2021, 13:12Hello Pablo,
Can I have an update about where my request is in the queue? My project being dependent on this currency switching feature, is now stalled for 2 weeks.
Thanks for your understanding.
Ajit M.
Hello Pablo,
Can I have an update about where my request is in the queue? My project being dependent on this currency switching feature, is now stalled for 2 weeks.
Thanks for your understanding.
Ajit M.
Quote from Pablo Borysenco on April 6, 2021, 10:09Hello Ajit
You are now third in line.
More likely we will customize for you on April 16
Hello Ajit
You are now third in line.
More likely we will customize for you on April 16
Quote from ajitmohun on April 6, 2021, 12:20Hi Pablo,
Thanks for the update. I can work with that.
Regards,
Ajit M.
Hi Pablo,
Thanks for the update. I can work with that.
Regards,
Ajit M.
Quote from Pablo Borysenco on April 16, 2021, 20:06Hello Ajit
In file - "wp-content\plugins\yith-woocommerce-subscription-premium\includes\class.ywsbs-subscription-cart.php" add code - https://c2n.me/4bIZaqg.png
$rate = 1;
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
}
}
}AND https://c2n.me/4bIZdQA.png
$rate = 1;
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
}
}
}AND - https://c2n.me/4bIZgJO.png
$rate = 1;
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
}
}
}In file - "\wp-content\plugins\yith-woocommerce-subscription-premium\includes\class.ywsbs-subscription-synchronization.php" - add code - https://c2n.me/4bIZnpr.png
$rate = 1;
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
}
}
}
And do a test
Hello Ajit
In file -"wp-content\plugins\yith-woocommerce-subscription-premium\includes\class.ywsbs-subscription-cart.php" add code - https://c2n.me/4bIZaqg.png
$rate = 1;
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
}
}
}
AND https://c2n.me/4bIZdQA.png
$rate = 1;
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
}
}
}
AND - https://c2n.me/4bIZgJO.png
$rate = 1;
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
}
}
}
In file -"\wp-content\plugins\yith-woocommerce-subscription-premium\includes\class.ywsbs-subscription-synchronization.php" - add code - https://c2n.me/4bIZnpr.png
$rate = 1;
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
}
}
}
And do a test
Quote from ajitmohun on April 16, 2021, 23:25Hi Pablo,
I made all the changes as you requested.
I noticed an improvement, however on the Cart & Checkout pages, when I switch the currency there, it remains with the 1st chosen currency. This is not expected. Customers should be able to change the currency on the Cart & Checkout pages as well.
Please see screenshot: https://tamarindleafyoga.com/wp-content/uploads/2021/04/screenshot-cart_20210417.jpg
The Recurring totals is not consistent with the Total and Subtotal numbers.
Please advise.
Thanks and regards,
Ajit M.
Hi Pablo,
I made all the changes as you requested.
I noticed an improvement, however on the Cart & Checkout pages, when I switch the currency there, it remains with the 1st chosen currency. This is not expected. Customers should be able to change the currency on the Cart & Checkout pages as well.
Please see screenshot: https://tamarindleafyoga.com/wp-content/uploads/2021/04/screenshot-cart_20210417.jpg
The Recurring totals is not consistent with the Total and Subtotal numbers.
Please advise.
Thanks and regards,
Ajit M.
Quote from Pablo Borysenco on April 19, 2021, 10:29Hello
Ok! I will check it
Hello
Ok! I will check it
Quote from ajitmohun on April 20, 2021, 00:41Hi Pablo,
Do you have any update?
Thanks,
Ajit M.
Hi Pablo,
Do you have any update?
Thanks,
Ajit M.
Quote from Pablo Borysenco on April 20, 2021, 12:24Hello
The developer will check this on Friday.
Hello
The developer will check this on Friday.