Skip Navigation

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.

This topic contains 34 replies, has 3 voices.

Last updated by T4ng 6 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
July 3, 2024 at 2:15 pm #15885206

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the details. And apologies if you feel this is a frustrating case. Since it was fixed on the provided site (staging), but wasn't fixed in the live site where we don't have any access. So all we can guide you how we fixed and you can try that on the live site.

Also I've tried my best to reply you and keep you updated on priority basis.

For the live site, which we usually don't encourage working directly on, we 'll need to go through the same investigation process. Because fixing in one site can not guarantee on the other site (if things, including hosting environment aren't the same).

Anyways, since you've refreshed the staging site, I checked and everything looks fine apparently.

BUT, hidden link is redirecting to hidden link (notice the "downloads"). This is a strange and perhaps there are some places which need more in-depth investigation. I also noticed that some of the URLs (i.e. hidden link) isn't working, which you mentioned is working for you.

I am working further on it and 'll get back to you accordingly. This may take some time because I need to check more configurations and database entries.

Your patience and cooperation is highly appreciated.

July 3, 2024 at 2:28 pm #15885288

Ton

Yes it's frustrating, but not directly to you, just because it's unfindable.

The URL's you mentioned are working again.

Thank you for further investigating. There must be something up in the database i assume too. But can't find it.

I will await your reply.

July 4, 2024 at 6:34 am #15889288

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

Yes some of these (i.e. English and Dutch) were working but French and German weren't. Because I saw that in WCML -> Store URLs, translations of "products" slug (Product category base) were missing for French and German. So adding the translation, made these work like:

- French: hidden link
- German: hidden link

However, French redirects to hidden link (notice the faq, while it was download previously) and German returns "Seite nicht gefunden" (page not found).

On top of that, if you go to Products -> Categories, and click "View" for French category (Treuils à main), it takes you hidden link where it loads content fine.

Same is the case with German.

I've checked .htaccess and trying to dig more in the database. However, I need to take a copy of this staging site, to try on my local, as well as to escalate to the 2nd tier team.

For this purpose, I need to remove all the inactive plugins and themes, to reduce the size of the package and I need your permission and confirmation about it.

Screenshot 2024-07-04 111834.jpg
Screenshot 2024-07-04 111827.jpg
Screenshot 2024-07-04 111821.jpg
Screenshot 2024-07-04 111816.jpg
Screenshot 2024-07-04 111808.jpg
July 4, 2024 at 7:06 am #15889514

Ton

Hello Waqas,

That's OK, I just remove the unneeded plugins for you.
You can remove any other things you don't need, also media etc.

Of course only on hidden link, this is just a test-site, so no problem.

July 4, 2024 at 10:23 am #15891162

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the details and the confirmation.

I've done a little more cleanup around themes and the media and 've downloaded the site package. I'll setup on my local, investigate and 'll proceed further accordingly.

I'll update you on this accordingly. Please keep the access to the staging site open.

July 4, 2024 at 1:45 pm #15892495

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

Just wanted to update that I am working on it and investigating on my local setup. However, so far I don't have any luck, but I'll keep digging and 'll update you tomorrow on this.

July 5, 2024 at 7:09 am #15896633

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I am done testing on my localhost and issue is evident, however, not being able to identify the actual reason.

So I'm migrating your staging site to our Cloudways test server (hidden link) and 'll escalate to the 2nd tier.

I'll update you soon on this.

July 5, 2024 at 8:54 am #15897237

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

First of all please note that I had to delete the previous CW site and then create a new one at hidden link.

While I was escalating the issue, I then found more clues about the said issues and noted that the redirection issues are coming due to the "same slug" used in Pages (see attached).

Please also check for the pages, posts and products, these all should use unique slugs and shouldn't have a matching slug with Store URLs (or base slugs).

I'll recommend trying this in the above mentioned CW site. The user/pass is the same as you provided me for your staging site.

Please let me know.

fr page.jpg
de page.jpg
July 8, 2024 at 6:07 am #15909972

Ton

Hello Waqas,

I don't see how this is going to fix the issue that the BASE slugs of the translated "products", "producten", "produits" and "produkte"?

When these URL's are fixed, it will not redirect anymore.
The redirects are not my problem, the BASE slug of the product category not translating properly IS.

Hope you agree with me and maybe escelate to a collegue of yours futher.

Kind regards

July 8, 2024 at 8:11 am #15910810

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I've already prepared for escalation but I am wondering what happened to CW site, which I prepared and provided you for checking.

I see all the plugins have been deleted. Did you change anything by chance?

July 8, 2024 at 8:23 am #15910941

Ton

No i did not change a thing on your CW site.
All i did was delete the inactive plugins for you on my dev site. Cause you needed it to be small.

Nothing more.

July 8, 2024 at 8:35 am #15911046

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Ok, thank you for confirming.

I've escalated the issue already. Please keep your dev/staging site active and access open as you provided earlier.

I'll update you as soon as I hear back from the team.

July 8, 2024 at 2:30 pm #15913985

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your cooperation.

I received the following reply from the 2nd tier:

I just realised that the product categories don't even work in English if I disable all plugins except for WooCommerce.

Try to

- disable all plugins except WooCommerce
- re-save permalinks
- go to Products > Categories and then click the View link for one of the categories, might as well limit ourselves to an English one such as hand-winches, i.e. site.url/products/hand-winches/, and note that it goes to a 404, even though there are plenty of products with the product category assigned.

So, [even] no WPML involved, and it [still] doesn't work.

Let's request the client to fix it so that things at least work as expected with no WPML, and then we can investigate if activating WPML means it doesn't work in other languages.

Please let me know with your findings based on the above mentioned.

July 9, 2024 at 6:02 am #15917893

Ton

Hello Waqas,

I just did as you asked on my site and it works just fine:
hidden link

Are you still using my copy as a base?

Hope to get a fix soon.

Kind regards

July 9, 2024 at 7:06 am #15918311

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates, I've informed the team and 'll get back to you accordingly.