Skip Navigation

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

Problem:

Is there a way to translate the "pa_attribute_*" part of the URL? Example, on the cart page, the selected variation will have something like /de/produkt/de-product-test/?attribute_pa_size=klein - is there a way to translate the "size" part from this attribute_pa_size?

Solution:

Unfortunately, there's no way to achieve that at the moment.

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: 

This topic contains 13 replies, has 2 voices.

Last updated by Ahmed Mohammed 1 year, 4 months ago.

Assisted by: Ahmed Mohammed.

Author Posts
June 19, 2023 at 12:01 am #13846463

nickS-28

I am trying to:

localize attribute slugs correclty

Link to a page where the issue can be seen:
hidden link

I expected to see:
option to localize attribute slugs correclty

Instead, I got:

no option to localize attribute slugs correclty

default language is German. the bug causes this situation: German attributes are marked as English and cant be changed

slugbug.png
June 19, 2023 at 11:53 am #13851021

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

Thank you for contacting WPML support!

I understand that when you go to WooCommerce Multilingual & Multicurrency → Store URLs, you find slugs for the German attributes registered in English instead of German.

Could you please go to Products → Attributes → Edit the affected attribute → Disable the Enable archives? option → Update.
After that, enable that option again and let us know how it goes.

Looking forward to hearing back from you.

June 20, 2023 at 3:03 pm #13861421

nickS-28

Hi,

Thanks.

Tried, but still does not work.

June 21, 2023 at 1:13 pm #13868327

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

Thank you for trying that. I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated.

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

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" 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 with you.

IMPORTANT

- Please backup site files and database before providing us access.
- If you do not see the wp-admin/FTP fields, your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box.

The private box looks like this:
hidden link

Looking forward to hearing back from you.

June 21, 2023 at 6:22 pm #13871005

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

Thank you for providing the login credentials.

I was able to log in successfully and I noticed that the "groesse" slug language was correctly set to German as shown in the attached screenshot, without me doing anything.

I'm going to check the other slug "duft". In the meantime, could you please share any information on how you fixed that?

June 21, 2023 at 6:27 pm #13871013

nickS-28

for some strings, it is possible to choose it and change the language at the bottom.

however, the translations are still nto reflected on the frontend

attribute2.png
attribute1.png
June 21, 2023 at 7:12 pm #13871293

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

Thank you for providing the requested details.

I was able to change the language for the affected slug by following these steps:

1. In WPML → String Translation, I searched for that slug and deleted the string.
2. In WooCommerce Multilingual & Multicurrency → Store URLs, I added the German translation to the slug. This step is needed to force the string to reappear in the string translation table.
3. In WPML → String Translation, I changed the string language.

Also, I recorded the process here: hidden link.

Could you please try translating the string under WooCommerce Multilingual & Multicurrency → Store URLs and let me know if the issue is fixed?

Looking forward to hearing back from you.

June 21, 2023 at 8:52 pm #13871731

nickS-28

hi there,

Thanks, unfortunately still not working.

The English version is translated in WooCommerce and the String Translation, but the frontend attribute URLs in English do not reflect it

3.png
2.png
1.png
June 22, 2023 at 12:37 pm #13876641

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

I was able to replicate the same behavior on this sandbox website: hidden link (this is a quick login URL).

The URL from the cart contains a custom field that starts with "pa_attribute_", not the attribute slug translated in WooCommerce Multilingual & Multicurrency or String Translation.

I will consult our second-tier team to find out how we can translate the pa_attribute_ section of the URL. As soon as I receive a response, I will inform you promptly.

June 26, 2023 at 12:50 pm #13895429

nickS-28

is there an upate here?

June 26, 2023 at 12:51 pm #13895431

nickS-28

*update

June 26, 2023 at 1:34 pm #13895803

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

We have been discussing this with our second-tier support team, and the attribute slug you translate in WooCommerce Multilingual & Multicurrency → Store URLs is the slug for the attribute archive that you can find here, for example, hidden link (notice the "grosse" part).

This is different from the URLs in the cart. After checking the WooCommerce code, it was concluded that it's difficult to translate the part of the URLs that starts with "pa_attribute_" without changing WooCommerce code itself.

Also, if you visit this URL: hidden link (this is the link from the cart), you'll find the correct variation is selected on the product page as shown in screenshot #1.

However, if you change the "size" part in the URL and visit the URL, you'll find no variations are selected, which is not the desired output.

20230626 at 16.33.33.png
20230626 at 16.32.32.png
June 26, 2023 at 1:36 pm #13895851

nickS-28

ok, so it is not a bug per se, but WPML is not fully compatible with WooCommerce, thanks 🙂

June 26, 2023 at 5:45 pm #13897643

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi Nick,

Thank you for your understanding. I regret that we were unable to meet your needs at this time. Your ticket will be closed for now, but please don't hesitate to contact us again if you need further assistance in the future.