I'd like to file a bug for the plugin "WooCommerce Multilingual & Multicurrency". We found that, when adding more than half the available stock of a product to the cart, then switching the language on the product page, then adding the same number of the same product (but translated) to the cart, the cart accepts the summed up product quantity despite exceeding the available stock quantity set for it. This leads to a bad user experience as the cart is not corrected automatically.
Steps to reproduce:
1. Visit hidden link
2. Add 7 shirts of size L to the cart
3. Switch to German in the top left corner
4. Again, add 7 shirts of size L to the cart
What we expect:
The cart should reject a quantity of 14 as only 9 shirts are available.
Actual behavior:
14 shirts are accepted in the cart and this can only manually be corrected. Warnings are displayed in the cart page and in checkout.
The function `wcml_check_on_duplicate_products_in_cart` seems to be the culprit. Here, the quantities of the original and translated products are simply summed up without checking against the stock quantity limit (woocommerce-multilingual/inc/class-wcml-cart.php:438).
We would like to request an update fixing this issue.
I reviewed our internal tickets and found the developers of WCML discussed this previously and decided not to handle this case.
It is an unusual scenario. It is not so unusual for someone to shop in one language, then after adding items to a basket notice that other languages are available and to change language then continue shopping. The unusual part would be having added several items of one product to the cart, then changing language, to then go ahead and add more of the same product but in a different language to the cart.
And if a client were to do this, then no error occurs because a warning about the quantity if shown on the checkout page.
If you don't like that then I would recommend the setting to reset the cart when switching langauge (at WooCommerce > WooCommerce Multilingual & Multicurrency > Settings).
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.