This thread is resolved. Here is a description of the problem and solution.
Problem:
The problem I've got is that if you start on the US site and add a product to the cart you get sent to the EU site.
Solution:
Go to WooCommerce > WooCommerce Multilingual > Status > click to create missing store pages.
Relevant Documentation:
https://wpml.org/documentation/related-projects/woocommerce-multilingual/#store-pages
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.
This topic contains 5 replies, has 3 voices.
Last updated by anthonyW-6 4 years, 6 months ago.
Assisted by: Dražen Duvnjak.
Author | Posts |
---|---|
April 24, 2020 at 3:17 pm #5987801 | |
anthonyW-6 |
hidden link This is a Woocommerce site set up with 4 languages: US - US English (default) The problem I've got is that if you start on the US site and add a product to cart you get sent to the EU site If you then add to cart a 2nd time you now get sent to the UK site. The correct behaviour is that a customer should stay on the language site they were on when adding to cart. I can't figure out why this is happening. I've seen a few threads saying to make sure this setting is enabled: Is there anything else I can check? |
April 27, 2020 at 2:38 pm #6003345 | |
George Botsev Supporter
Languages: English (English ) Timezone: Europe/Sofia (GMT+02:00) |
Hello and thank you for contacting us. Please check if there are any warnings and notices in your admin related to WooCommerce. Also check the status page in WooCommerce > WooCommerce Multilingual > Status - for any issues that might be there. It is possible that you are missing key WooCommerce pages in the other language, and because of that the issue could happen. I also suggest to try in a minimal setup - with only WoooCommerce, WPML plugins and a default theme like "Storefront" if you can reproduce the issue - so that we can rule out any custom code issue. |
April 27, 2020 at 7:20 pm #6005517 | |
anthonyW-6 |
Hi George, Thanks for that. The status page in WooCommerce > WooCommerce Multilingual > Status showed that some store pages were missing and clicking that button has mostly fixed the issue - I am now not sent to other languages when adding to cart. Having said that, the cart URLs do not look quite right and it looks like there may be some duplication somewhere. These are the cart URLS the site now uses: hidden link (I've printed them again below as relative URLs for the benefit of forum readers) US site: /cart-2/ The UK and German cart URLs are fine, but the US and EU cart have the extra -2 or -3 in them which makes our tracking/analytics more complicated. How can I change them to be as follows please? US site: /cart/ Thanks for your help! |
April 28, 2020 at 6:27 am #6008295 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, Glad to hear your issue is now solved. To change URLs of store pages URL follow the next steps: 1) Go to the WooCommerce -> WooCommerce Multilingual page and click the Store URLs tab. 2) You will see a list of URLs and a column with translation status for each language. 3) Click on the Pen icon to edit existing URL translations or the Plus icon to add URL translation. The shop, cart, checkout, and account pages These page URLs are translated by translating the respective WooCommerce pages. 1) Go to that respective edit page screen and click the language switcher on the top to switch to the translation of the cart page. 2) Edit the URL of the translated page and save it. Please check our documentation: https://wpml.org/documentation/related-projects/woocommerce-multilingual/#urls Let me know how it goes and if you still need my help. Regards, |
April 28, 2020 at 9:04 am #6009427 | |
anthonyW-6 |
I couldn't find the cart slugs on that page, but I found this thread that said to edit the permalinks against the cart page: https://wpml.org/forums/topic/cart-url-change-to-cart-2/ Unfortunately it did not work for me 100%, when I try to edit the cart slug for USA to "cart" instead of "cart-2" it immediately resets. I figured out "cart" slug was already taken in EU - in my list of EU pages I found 2 extra cart pages, so after deleting those I was able to rename the cart page to "cart", but for USA I cannot see another page with using the slug "cart" although I believe it exists. How can I find and delete the US "cart" page so that I can free it up for "cart-2" to use instead? |
April 28, 2020 at 10:20 am #6010579 | |
anthonyW-6 |
Ok, I don't know why the page was hidden, but I found it using this hack and then deleted it: Incidentally I think my slug problems were caused by the "WooCommerce Multilingual > Status" page fix buttons. It said content would not be created if it was not needed, but I ended up with multiple pages in some regions so that was not really true. The cart functionality works perfectly now though, so thanks for your help. |