Skip Navigation

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

Problem:
Product attribute terms with the same slug (using the method described here https://wpml.org/errata/translated-term-slug-identical-to-the-original-term-slug/) are assigned to the wrong language product with the wrong term count. This happens only after using the sync feature in WooCommerce → WooCommerce Multilingual → Attributes → Sync variations.

Solution:
Update the WooCommerce Multilingual to the latest version but if you're using the version prior to 4.12.0, go to /wp-content/plugins/woocommerce-multilingual/inc/translation-editor folder, and edit the class-wcml-synchronize-product-data.php file. Just look for this line of code:

if ( is_taxonomy_hierarchical( $taxonomy ) ) {

and replace it with

if ( is_taxonomy_hierarchical( $taxonomy ) || true ) {

Once you did this, just simply synchronize again the terms and the count will work fine.

Это форум технической поддержки WPML – плагина для многоязычной WordPress.

Доступно для чтения всем, но только клиенты, купившие WPML, могут оставлять сообщения. Сотрудники WPML отвечают на сообщения форума 6 дней в неделю, 22 часов в сутки.

Сотрудники Службы поддержки сегодня не доступны на форуме Russian. Создайте обращение и мы возьмемся за решение вашего вопроса, как только будем в сети. Благодарим за понимание.

This topic contains 24 ответов, has 3 голосов.

Last updated by Radu 1 месяц, 2 недели назад.

Assigned support staff: Radu.

Автор Посты
13 января, 2021 в 12:28 пп #7834767

Radu
Supporter

Languages: Английский (English )

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

Hey Bohdan,

I deleted the English term, translated it, synchronized the terms, then went back here:
hidden link

and removed the -en part by using the quick edit option.

Once I did that, I checked one of the English products here:
hidden link

and the Port of departure is showing well. The link when I press the Alanya text works fine too:
hidden link

Thanks,
Radu

13 января, 2021 в 12:39 пп #7834857

bohdanM

Hi, Radu

Yes, it is, but if you change the following parameter in the same way, for example Antalya
After synchronization in Alanya there will be zero (

13 января, 2021 в 2:36 пп #7836195

Radu
Supporter

Languages: Английский (English )

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

Hey Bohdan,

I did the same for the Antalya category. I translated it, synchronized the products, then removed the -en part using the quick edit option. Everything works fine. Can you have a look, please?

Thanks,
Radu

13 января, 2021 в 2:39 пп #7836257

bohdanM

Hi, Radu

But the previous changes to zero
hidden link

14 января, 2021 в 9:15 дп #7841709

Radu
Supporter

Languages: Английский (English )

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

Hey Bohdan,

I was able to replicate this issue on a clean website. In this case, I asked my colleagues to have a look at this too, and see if there's something that I'm missing out, or if I should escalate this to the development team. I'll give you a message back as soon as I get a reply from my colleagues (which shouldn't take long).

Thanks,
Radu

14 января, 2021 в 11:28 дп #7843345

bohdanM

Hi, Radu

Thank you, I will wait for a solution

14 января, 2021 в 11:57 дп #7843659

Radu
Supporter

Languages: Английский (English )

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

Hey Bohdan,

I will definitely keep you posted about the progress on this issue. I tried a few more changes, but they didn't work so I'll have to escalate this to the 2nd tier support to have a closer look.

Thanks,
Radu

15 января, 2021 в 2:20 пп #7853871

Radu
Supporter

Languages: Английский (English )

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

Hey Bohdan,

My colleague checked this out and found a fix.

Please go to /wp-content/plugins/woocommerce-multilingual/inc/translation-editor folder, and edit the class-wcml-synchronize-product-data.php file. Just look for this line of code:

if ( is_taxonomy_hierarchical( $taxonomy ) ) {

and replace it with

if ( is_taxonomy_hierarchical( $taxonomy ) || true ) {

Once you did this, just simply synchronize again the terms and the count will work fine. I already tried to do this on the test website and it's working as expected. Please let me know how this goes for you.

Thanks,
Radu

15 января, 2021 в 3:04 пп #7854545

bohdanM

Hi, Radu

Yes, this solution helped to solve the problem

The question arises, what about updates to this plugin?

Thank you

15 января, 2021 в 4:23 пп #7855209

Radu
Supporter

Languages: Английский (English )

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

Hey Bohdan,

I'm glad to hear that this did the trick 🙂

The fix will be included in the next version of the WooCommerce Multilingual plugin, so you won't need to make this change again.

Regards,
Radu