Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 - -
16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

This topic contains 35 replies, has 1 voice.

Last updated by Itamar 1 month, 1 week ago.

Assisted by: Itamar.

Author Posts
August 10, 2025 at 7:55 pm #17307938

robertM-124

Hi,

Thank you!
will do tomorrow and will let you know.

-Regards

August 11, 2025 at 9:52 am #17308956

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Sure, thanks for your update.

I'll be waiting to hear from you if you need further help with this issue.

Regards,
Itamar.

August 12, 2025 at 6:57 pm #17314899

robertM-124

Hi,

So I tried the method (https://wpml.org/forums/topic/we-need-a-way-to-translate-custom-product-attribute-names-imported-via-wpml-tools-without-using-str/) and the local attributes keep disappearing after an edit. I am not sure if I did that correctly though. Could you please check?
The link to the original and translated content on separate sheets: hidden link

Code used:
<?php

$attrLabelTranslations = ['ka' => ['attribute:ცხობის მასის პარამეტრები' => 'attribute:Baking Mass Settings',],['attribute:ქერქის ფერი' => 'attribute:Bark color (level)',],['attribute:მასალა' => 'attribute:Material',],['attribute:კაბელის სიგრძე (მ)' => 'attribute:Cable length (m)',],['attribute:ზომები (სმ)' => 'attribute:Size (cm)',],['attribute:წონა (კგ)' => 'attribute:Weight (kg)',],['attribute:მოდელის/ნაწილის ნომერი' => 'attribute:Model/Part Number']];

echo serialize( $attrLabelTranslations );

Result:
a:7:{s:2:"ka";a:1:{s:78:"attribute:ცხობის მასის პარამეტრები";s:30:"attribute:Baking Mass Settings";}i:0;a:1:{s:41:"attribute:ქერქის ფერი";s:28:"attribute:Bark color (level)";}i:1;a:1:{s:28:"attribute:მასალა";s:18:"attribute:Material";}i:2;a:1:{s:56:"attribute:კაბელის სიგრძე (მ)";s:26:"attribute:Cable length (m)";}i:3;a:1:{s:37:"attribute:ზომები (სმ)";s:19:"attribute:Size (cm)";}i:4;a:1:{s:31:"attribute:წონა (კგ)";s:21:"attribute:Weight (kg)";}i:5;a:1:{s:72:"attribute:მოდელის/ნაწილის ნომერი";s:27:"attribute:Model/Part Number";}}

The product uploaded and tried editing on the testing server you set-up: hidden link

Best regards

August 14, 2025 at 4:43 pm #17321745

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Thanks for trying the workaround.

I assume you are referring to the მოდელის/ნაწილის ნომერი custom attributes.
Is this correct?

If so, I observe a few problems.

A. This attribute was not even imported correctly in Georgian. Only the forward slash (/) is there. Please see the attached screenshot forward-slash.jpg. It might be that it is not possible to include this sign in an attribute label. (This is just an assumption from my side.) So, not being imported into Georgia can be the root of the problem.

B. As far as I can see, you have not added the following functions to the functions.php file of the active Twenty Twenty-One theme.

/**
 * <em><u>hidden link</u></em>
 *
 * Force unserializing of meta data in WC importer.
 */
add_filter( 'woocommerce_product_importer_parsed_data', function ( $data ) {
    if ( isset( $data['meta_data'] ) && is_array( $data['meta_data'] ) ) {
        foreach ( array_keys( $data['meta_data'] ) as $k ) {
            $data['meta_data'][ $k ]['value'] = maybe_unserialize( $data['meta_data'][ $k ]['value'] );
        }
    }

    return $data;
} );

I'm sorry that this code is broken on the link I sent you. I've just fixed it.

C. Your PHP and, in turn, the serialized array are not following this format:

[ 'LANGUAGE_CODE' => [ 'ORIGINAL-ATTRIBUTE-NAME-SLUG' => 'TRANSLATED ATTRIBUTE NAME', ], ]

It is supposed to look something like this, for example:

[ 'ka-ge' => [ 'მოდელის-ნაწილის-ნომერი' => 'Model/Part Number', ], ];

And it is supposed to be for each attribute separately and not as you put it all together.

In any case, writing these lines now, I'm not sure it is the solution for you. I need to consult our second-tier supporters about it. I'll keep you updated about this.

However, I still think you should stick to the guide here:
hidden link
I still don't see the following columns in your CSV files:

wpml:language_code

wpml:original_product_id
(or)
wpml:original_product_sku

I know you said you mapped them. But I think that the columns must be there.

Please note that my weekend hours are Friday to Saturday. If you need further assistance, I'll be available to continue checking this issue and helping you next week.

Regards,
Itamar.

forward-slash.jpg
August 18, 2025 at 4:40 pm #17328962

robertM-124

Hello Itamar,

thank you for the breakdown.

I need a little more information on the "[ 'ka-ge' => [ 'მოდელის-ნაწილის-ნომერი' => 'Model/Part Number', ], ];" field you want to see in the import file.

I can see an interrupted inner and outer arrays. Also, the elements of the array contain the labels only, not the values. The guide from the link also does not include any values, just the labels in the custom meta field:

3. Add an extra column 'Meta: attr_label_translations' to your CSV file.
4. Populate this column with serialized values for the attribute label translations. Use the structure [ 'LANGUAGE_CODE' => [ 'ORIGINAL-ATTRIBUTE-NAME-SLUG' => 'TRANSLATED ATTRIBUTE NAME', ], ]

The link to the PHP sandbox from the guide suggests a short code of the translation language (not original):

```<?php

$attrLabelTranslations = [
'da' => [
'size-range-en-test-lucas-imported-2' => 'Range DA Test Lucas Imported 2',
],
];

echo serialize( $attrLabelTranslations ); ```

So, I did the following.
1. I replaced my snippet in the functions PHP, with your new one.
2. I renamed columns to wpml:original_product_sku and wpml:language_code to avoid any confusion.
3. I replaced "ka" with "en" as in the example in the guide.
4. I kept the "Meta: attr_label_translations" field as is, since I don't understand how it should be for each attribute separately:

* If it assumes I use the standard WP import and I need to put the [ 'LANGUAGE_CODE' => [ 'ORIGINAL-ATTRIBUTE-NAME-SLUG' => 'TRANSLATED ATTRIBUTE NAME', ], ] in the "attribute name" field, then it's unclear why the nested and outer array have extra commas.

* Also, in that case that would be unclear why I need "Meta: attr_label_translations" field and what should I put there.

Testing:

Uploaded without errors, translations applied.
After some strange behavior with Georgian local attributes, I realized that I accidentally deleted the Webtoffee's BOM processing code from functions.php.
I recovered the code, entirely deleted the products and uploaded again along with translations.
Some global attributes got duplicated on the translation. So, I run the troubleshooter. It made locals disappear; therefore I uploaded translation again.
I tested on hidden link . Altered warranty (გარანტია) from 24 to 60 to see how local translation behave.

Final result:

Locals disappeared.

Best Regards

August 21, 2025 at 1:06 pm #17337593

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Our second-tier supporter wrote the following about this case:

In most cases, when things disappear out of nowhere, it's because there's a DB entry missing. If it was added in any way by the plugin, it could be that something is missing, so ATE would not see it and pass it to the translations.

In light of this, I suggest you try again when the Advanced Translation Editor is canceled. In other words, although it is less convenient, don't work with the Advanced Translation Editor for products that you imported with the Product Import Export for WooCommerce Add-on plugin. You cancel it in the editing screen of each product. You can cancel it for a specific product or all products. Please see the attached screenshot. Then make a new import and check what happens in this case.
Do you still have a problem with the custom attributes?

If the answer is yes, then we must escalate this ticket to our second-tier supporter with a copy of the sandbox site. For this, I want to ask you the following, please (on the sandbox site).

1. Simplify as much as possible your CSV. I mean, reduce the number of columns to the minimum required. Just include the columns needed to replicate the problem. Also, please add just one or two products to this file. This will make the file more manageable and easier to understand.

2. Share with us this file. You can upload it to a service like Google Drive or Dropbox and share the link with me. Or explain where we can find it on the site.

3. Write to us the steps to reproduce the problem. Start from the import process and then move to the steps that trigger the problem. Please write in steps: 1. 2. 3... and so on. It would also be helpful if you could share a clear video on the above steps, where you are explaining what you do. You can use the free online screencast service Komodo - hidden link. This should help me see if you do anything wrong.

Then I'll create a copy of the sandbox site and escalate it to our second-tier supporters.

Please note that my weekend hours are Friday to Saturday. If you need further assistance, I'll be available to continue checking this issue and helping you next week.

Thanks,
Itamar.

2025-08-21_15-51-14.jpg

The topic ‘[Closed] Products tables desyncronization’ is closed to new replies.