This thread is resolved. Here is a description of the problem and solution.
Problem:
In a WooCommerce shop with multiple languages, the 'product-category' slug was translated for different languages. However, for the German language, setting the slug to 'produkte' results in a 404 error when visiting the page. The backend shows the Dutch translation instead.
Solution:
We analyzed the issue and determined it is not directly related to WPML or WooCommerce, but rather to the permalink structure used. WordPress uses specific rules to determine what content to display based on the URL visited. If both single products and product categories share a similar permalink base (e.g., site.com/products/), WordPress may struggle to differentiate between product requests and product category archive requests, leading to errors like the one experienced. We recommend changing the permalink structure so that products and product categories do not use the same base. For example, use 'products' for the product category base and '/product/%product_cat%/' for the custom product base. This adjustment should resolve the issue.
If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket at WPML support forum for further assistance.
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.
Tagged: Exception, Not WPML issue
This topic contains 34 replies, has 3 voices.
Last updated by T4ng 3 months, 2 weeks ago.
Assisted by: Waqas Bin Hasan.
Author | Posts |
---|---|
June 10, 2024 at 10:15 am | |
Ton |
We have a WooCommerce shop and we have multiple languages. We have translated the "product-category" slug for the different languages But for 1 language its not working Now when i look in the backend at the product category, it shows the NL translation :/ |
June 10, 2024 at 10:26 am | |
June 10, 2024 at 10:28 am #15721347 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Reference to our recent chat, please try the following: 1) Take a full backup of your site and database before proceeding. And let me know your findings and I'll try my best to help you further on the matter. Regards. |
June 17, 2024 at 7:46 am #15743676 | |
Ton |
For now, this suddenly fixed it self. Please leave the ticket open if it happens again. Than I will report back. |
June 18, 2024 at 7:58 am #15747752 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Glad to know that problem is solved. However, keep this ticket with you and if you run into the issue again, feel free to write back. Have a great time. |
June 24, 2024 at 11:35 am #15806418 | |
Ton |
Hello, So the issue returned. I made a dev enviremont and with only the needed plugins. hidden link It has something to do with the permalink I believe. I have translated the shop URL's via this way: Hope to hear from you. Kind regards |
June 24, 2024 at 1:38 pm #15807707 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates. I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated. Your next answer will be private, to share this information safely. Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend. IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also. See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security. |
July 2, 2024 at 6:30 am | |
July 2, 2024 at 9:30 am #15873841 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the access. I am working on this and 'll get back to you as soon as I find something or have a solution. |
July 2, 2024 at 1:07 pm #15875493 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience, I'm still working on this and 'll update you by tomorrow. |
July 3, 2024 at 6:53 am #15880918 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience and cooperation. I was able to analyze issue in detail and in fact this isn't an issue but a matter of understanding. In WooCommerce, you can not have duplicate base-slugs (see attached images highlighted with Red). Your shop page, category base, attributes base and product permalinks base has the same slug and this 'll always create problem. So I've demonstrated this by using unique (or different) slugs (attached images highlighted in Green) and now these work just fine. In short, if you go to WooCommerce -> WooCommerce Multilingual & Multicurrency -> Store URLs, the each slug under "Original Slug" column should be unique or different. And then should be translated accordingly. |
July 3, 2024 at 8:52 am #15882456 | |
Ton |
Hello Waqas, I just tried this in the live site by changing the Shop page URL. (See attached screenshot). Now it still doesn't work, but ONLY for German and French. I would like to show you the live site (the additional languages or only for logged in user right now). But the weird thing is: While this DOES work in Dutch: And even MORE WEIRD, this works too: Hope to hear from you. |
July 3, 2024 at 10:44 am #15883309 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates. Looks like there may be a caching issue or a conflict. I'll recommend to try the following: 1) Take a full backup of your site and database before proceeding. I understand this is a live site and above mentioned might be a concern. In this case, it is recommended to clone the site on a staging/dev site first and check as mentioned above. |
July 3, 2024 at 12:46 pm #15884384 | |
Ton |
Sorry but this has nothing to do with caching. I am kinda out of patience with this. You guys always tell the same little story to deactivate stuff etc. Can you please take a real look? If you logged in, there is no caching. So somehow on the German language: On the front end (in the menus) it's like this: I can make a new duplicate for you to take a look. |
July 3, 2024 at 1:09 pm #15884593 | |
Ton |
Hello Waqas, Ok so now I have the test enviremont completely STRIPPED from plugins etc, only what i needed. hidden link When you look in the backend CMS on hidden link in the different languages you see the following: English: hidden link Dutch: hidden link German: hidden link French: hidden link So please tell me you guys can fix this. Kind regards |