Home›Support›English Support›[Resolved] Multicurrency changing quantity on cart page change display to default currency.
[Resolved] Multicurrency changing quantity on cart page change display to default currency.
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing an issue where changing the product quantity on the cart page did not reflect the selected currency (GBP) but instead showed the default currency ($). This problem was only occurring on the cart page and was suspected to be a conflict with the "Tiered Price Table for WooCommerce" plugin.
Solution: We recommended a workaround involving the addition of custom code to the site. Here are the steps to follow: 1. Access and modify the
functions.php
file within your theme's directory. 2. Insert the following code snippet at the end of the file:
3. Clear both your site's caches and the cart after adding the code. 4. Add a product to your cart in a different currency and then adjust the quantity to see the issue resolved.
Please note that this solution might be outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If necessary, please open a new support ticket in the WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
I understand the problem you're having. In order to reproduce the issue, I set up multicurrency on my development setup and added a product to the cart after selecting the secondary currency. Upon changing the quantity from the Cart page, I noticed that the selected currency remained unchanged. The same currency shows even when I adjusted the quantity or carried out any action that initiated an Ajax request.
The problem you're experiencing could be due to a conflict with another plugin. Given the plugin you've identified as a potential source of the problem, which is "Tiered Price Table for WooCommerce", please note that it is not included in WPML's compatibility directory. You can also check here: https://wpml.org/plugin/
If the issue is resolved by deactivating the plugin, it would be advisable to contact the plugin's support team to report the problem. If the issue is related to their plugin code or configuration, they are likely to offer more specialized assistance in this matter. Hope you can understand.
Let me know the update, please. I will be happy to help if you need further assistance in this matter.
Hi Prosenjit.
I have created a clean test environment with only the following:
WordPress
WooCommerce
WooCommerce Multilingual & Multicurrency
see image
I added one product
and set two currencies
repro steps:
go to hidden link
click the product image to go to the product page
select GBP in the currency dropdown
click add to cart
click view cart
change the product quantity by click the + sign or type ne number in the box
currency display change from £ to $
this for sure a bug in the plugin as this a clean install with no other plugins
refresh the cart page or click to checkout display the GBP price again.
this seems to be some issue with the way the quantity change impact the price in. maybe some AJAX call.
Hello David,
Thank you for the detailed instructions.
I checked using the standalone version of the WooCommerce Multilingual plugin and have successfully replicated the problem. The ticket has been escalated to our second-tier team for a more in-depth investigation. I am hopeful that they will soon identify a resolution for this issue.
During the investigation, I found that the issue doesn't occur when WPML is activated on the site. As a temporary solution, you could activate and set up the WPML plugin. However, if you prefer to keep WPML deactivated, an alternative fix is to edit the Cart page and switch to the "Classic Cart" (refer to this screenshot: hidden link), which also helps to solve the issue.
Rest assured, as soon as I have more information on this, I will surely inform you.
Thank you for your patience. Our 2nd tier team has investigated the matter and identified a potential solution. To implement this workaround, please follow the steps outlined below:
1. Access and modify the `functions.php` file within your theme's directory.
2. At the end of this file, insert the following snippet of code:
3. After adding the code, please ensure to clear both your site's caches and the cart.
4. Add a product to your cart in a different currency and then try to adjust the quantity. The issue will not happen again.
I tested the solution and it worked perfectly in my development environment. So, please test and let me know the update. I will be happy to help if you need further assistance in this matter.
I put the code in a custom plugin dedicated to fix this issue.
the best practice is to avoid changing theme `functions.php`.
use a custom plugin or child theme instead...
in any case the 'add_filter' code fix the problem.
I'm all hope this will be addressed in the next update release for the plugin. I don't like to have custom plugins as a workaround unless I really have to...
Thanks,
David