Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is experiencing 404 errors when setting 'boutique' and 'shop' as Product category prefixes for their French and English WooCommerce shop pages, respectively. The desired URLs are:
- French: /boutique/cat_name
- English: en/shop/cat_name

Solution:
We recommend not using the same slug for the shop base and the product category base, as this causes conflicts in WooCommerce's custom permalink structure. WordPress requires unique slugs to distinguish between categories and products. Therefore, the client should choose a different base for the product category to ensure the category page works correctly on the frontend.

For more information, please refer to the WooCommerce documentation on permalinks:
https://woo.com/document/permalinks/

If this solution does not apply to your situation, or if it seems outdated, we highly recommend checking the 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 you still encounter issues, please do not hesitate to open a new support ticket with us.

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.

Our next available supporter will start replying to tickets in about 2.53 hours from now. Thank you for your understanding.

This topic contains 5 replies, has 2 voices.

Last updated by Long Nguyen 3 weeks, 6 days ago.

Assisted by: Long Nguyen.

Author Posts
March 28, 2024 at 12:37 am #15458520

victorM-56

I am trying to: my website is in french (default) and english. I woud like to have product category page with url like that :
- French : /boutique/cat_name
- English : en/shop/cat_name
Note : My french shop page is "/boutique" and english is "en/shop/"

Link to a page where the issue can be seen:
Temporarily, I put "boutique-2" and "shop-book" as Product category prefix because it's only don't work if I put "boutique" and "shop". This pages are working correctly :
hidden link
hidden link

I expected to see:
If I put "boutique" and "shop" as Product category prefix, I get 404 error. I woud like this URL:
hidden link
hidden link

Instead, I got: I get 404 error instead if I put "boutique" and "shop" as Product category prefix.

Thanks for your help

wpmlcat.png
March 28, 2024 at 2:59 am #15458591

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Victor,

Thank you for contacting WPML support, I’m happy to help you with this issue.

In the original language French, I do not see the category URL work hidden link
so it would be an issue with the permalink on your site, not an issue with WPML.

The page hidden link is a regular page, not a WooCommerce shop page and might cause the issue. Please follow steps below to setup the shop page and category permalink then let me know how it goes:

- Go to WooCommerce > Settings > Products tab > Shop page > Set the Boutique as the shop page.
- Go to Settings > Permalinks > Product category base > Add "boutique" to the base.
- Go to WooCommerce > WooCommerce Multilingual & Multicurrency > Store URLs > Translate the Product category base with "shop" slug.
❌ IMPORTANT: Please backup your database and website before proceeding ❌

Looking forward to your reply.
Thanks

March 28, 2024 at 11:14 am #15459963

victorM-56

Hello,

It doesn't work.
hidden link is set as shop page (in woocommerce setting). How did you check is a regular page instead shop page ?

I put "boutique" to the base of product category and add "shop" as english translation.

Still not working.

Product ur l are ok :
hidden link
hidden link

Only problem is Category URL.
Thanks.

wpml20.png
March 29, 2024 at 1:23 am #15462919

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

As far as I know, the shop page should have the body class "archive", "post-type-archive-product" but I don't see it on your shop page, see screenshot attached.

This issue occurs in the default language so I suggest you deactivate WPML for a while and recheck this issue. If it persists, so the issue isn't related to WPML.

If it works, please try to enable a minimal environment as below and see if it helps:
- Deactivate all plugins except WPML plugins and WooCommerce
- Switch to a standard theme of WordPress
❌ IMPORTANT: Please backup your database and website before proceeding ❌

Looking forward to your reply.
Thanks

Shop – WPML 2024-03-29 08-19-46.png
March 31, 2024 at 12:18 pm #15467250

victorM-56

Hello
Still almost 3 days, I gave staging website with admin login to your support here: https://wpml.org/forums/topic/menu-translation-error-in-the-db/

I can't do a second staging site to test. And I have to add a ticket/problem (because you asked for).

It would be great to speak by chat to someone that can help with my 3 errors :

- Error red warning https://wpml.org/forums/topic/menu-translation-error-in-the-db/
- Impossible to edit english menu because not visible :https://wpml.org/forums/topic/translate-menu-is-not-visible/
- Category product 404 error when I put "Boutique" at the base : https://wpml.org/forums/topic/product-category-url-slug/

Thanks

April 1, 2024 at 3:08 am #15467930

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I understand the issue. It's the custom permalink issue of WooCommerce itself, not related to WPML. You can read more about this issue in the WooCommerce documentation
hidden link

If you set the product base to "shop" for example, you should NOT set the product category base to "shop" too, as this will not be unique and cause a conflict. WordPress requires something unique so it can distinguish categories from products.

In general, you should use another base for the product category to make the category page work in the frontend.

Looking forward to your reply.
Thanks

April 2, 2024 at 10:14 pm #15475253

victorM-56

Thanks. I put a unique slug.

victorM-56 confirmed that the issue was resolved on 2024-04-02 22:14:03.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.