Skip Navigation

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 wait time is higher than usual, please make sure you are meeting the minimum requirement - https://wpml.org/home/minimum-requirements before you report issues, and if you can take a look at current Known Issues - https://wpml.org/known-issues/. Thank you.
Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 13:00 7:00 – 13:00 7:00 – 13:00 7:00 – 13:00 7:00 – 13:00 -
- 14:00 – 16:00 14:00 – 16:00 14:00 – 16:00 14:00 – 16:00 14:00 – 16:00 -

Supporter timezone: Europe/Paris (GMT+02:00)

Tagged: ,

This topic contains 10 replies, has 2 voices.

Last updated by Andrés 1 year ago.

Assisted by: Andrés.

Author Posts
April 3, 2024 at 11:49 am #15477836

martinJ-41

Hey,

We have 4 differents languages set up on our website (default english). We have a weird issue on the URL for products (making some issues for SEO - hreflang conflicts). We use the default setting for the product permalink - "/product/sample-product/" (permalink.png). We translated this field correctly (woocommerce-multilingual.png).

Now when we go on the front, this "product" slug is not translated (front-product-link.png). But when you visit a product alternate links in the head are correct (hreflang.png).
good : hidden link
bad : hidden link

I tried to use some filters :
$my_current_lang = apply_filters( 'wpml_current_language', NULL );
$product_url = apply_filters( 'wpml_permalink', get_permalink($product->get_id()), $my_current_lang );
but every time I have the bad url (hidden link)

Thanks for your help,

hreflang.png
front-product-link.png
woocommerce-multilingual.png
permalink.png
April 3, 2024 at 12:39 pm #15478438

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Europe/Paris (GMT+02:00)

Hello there,

Welcome to WPML support forum.

1. Could you please tell me if this issue appeared after updating to WPML 4.6.10?

2. If that's not the case, it could be either the theme, plugin or a combination of both. Therefore can you do the following: check if this issue appears in your test site when:

- Only WPML and WooCommerce plugins are activated, as it will tell us if there is an interaction issue with other plugin
- Theme is set to a WordPress default like Twenty Nineteen as it will tell us if there is an interaction issue with your theme

If you don't see the issue happening in the above scenario, could you start activating them one at the time until funding the culprit?

Best regards,
Andrés

April 3, 2024 at 12:56 pm #15478507

martinJ-41

Hey Andrés, We have this issue since a while now. It is not related to the new version. We still have the issue with only WPML and WooCommerce and the default theme Twenty Nineteen (as you can see in the screenshot). I also tried to clear the cache from the Support WPML and also click and the button "Scan now and adjust links" on the Translate Link Targets. Nothing change.

screenshot.jpg
April 3, 2024 at 1:41 pm #15478740

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Europe/Paris (GMT+02:00)

Thank you very much for the confirmation. Let's check the following:
- Go to WPML > Settings > Post Types Translation
- Look for the Product post type.
- Check that the slug is also translated there.
Does it help?

April 3, 2024 at 1:47 pm #15478772

martinJ-41

Yeah it is also translated there. Dont understand why on the alternate link we have the right one but when I try to get the URL in PHP I have everytime the wrong one.

custom-post-type.jpg
April 4, 2024 at 5:55 am #15480950

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Europe/Paris (GMT+02:00)

Hello,
I would like to request temporary access (wp-admin and FTP) to your test site to take a better look at the issue. Could you please indicate me how to replicate this behaviour?

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok for you.

*Important: Be sure to backup your site and database first before you proceed!
You can use a plugin for this if you like. You can use the Duplicator plugin for this purpose.
See: http://wordpress.org/plugins/duplicator/

If you don't see the form below, pelase don't add your credentials as they will be publicly exposed:
hidden link

Privacy and Security when Providing Debug Information for Support:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

April 4, 2024 at 7:09 pm #15485613

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Europe/Paris (GMT+02:00)

Thank you for your credentials, however I still need a bit more of your help.

1. I see that you haven't translate any product. Is the issue related to the "Translatable
use translation if available or fallback to default language" feature?

2. I can switch between products without any problem and the slug is translated. Could you please provide me a step by step of how to reproduce your issue? Probably I'm looking in the wrong spot.

Regards

April 5, 2024 at 7:20 am #15486470

martinJ-41

Yes it is completely normal (weird but normal 🙂 ). We don t want to translate the product but we want for the product categories.
If you want to reproduce the issue you have to visit one of the product categorie page, with
another language than english :
-> hidden link
-> all the products have the link like hidden link instead of hidden link

Thomas

April 5, 2024 at 12:38 pm #15488214

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Europe/Paris (GMT+02:00)

Hello Thomas,

I think I found what was missing but it is working now. Here you go what I've done:

1. Go to WooCommerce > WooCommerce Multilingual & Multicurrency > Status
- Create the missing pages from the "WooCommerce Store Pages" section.

2. Go to the Store URL's section and translate these endpoints:
- Shop page
- Product base

3. Go to WPML > Settings > Post Types Translation.
- Be sure the the Products slug is translated.

4. Finally, go to WPML > String Translation.
- Look for the "product" string under the "WordPress URL slug: product" domain.
- Be sure the string is translated (pencil) and not under the waiting status (Circle arrow).

It should be working now:
hidden link

Regards
Andrés

April 5, 2024 at 1:02 pm #15488279
martinJ-41

Hey Andrés,

Thanks for your response,

I have done all the steps, unfortunetaly it doesn't work 🙁 We still have the english slug for a product page when I m on the danish or german website as you can see here : hidden link (product instead of produkt)

Also when you are on the product page, the "breadcrumb" is not working (sometimes you are on the danish version and the breadcrumb is in english. So the issue is also visible here) :
hidden link (here we have 'Custom Suits' instead of 'Skraeddersyede Jakkesaet')

Thomas

New threads created by Andrés and linked to this one are listed below:

https://wpml.org/forums/topic/split-products-url/

April 5, 2024 at 2:00 pm #15488459

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Europe/Paris (GMT+02:00)

Thanks again, Thomas, I think I better understand your issue now. I'm afraid this situation has already been detected by our devs and it is a bug when you use the "Translatable - use translation if available or fallback to default language" feature.

If you open a product directly in English and you switch languages, you will see that the product leads to the right URL. However, it is not the case when you access to an archive page (category page in your case).

Under this scenario:
- You could duplicate your products as explained here:
https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#duplicating-content
or
- Create a custom redirection for the caregories page.

I'll escalate your issue to our devs but it may take a while to find a definitive solution.

On the other hand, for your new issue I've opened a new ticket. Please, let's continue here with the original problem.

Regards