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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 -
- 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 19 replies, has 3 voices.

Last updated by Nigel 5 months, 4 weeks ago.

Assisted by: Nigel.

Author Posts
May 16, 2024 at 9:02 am #15633929

basW-8

The csv that went okay is:
hidden link

The csv that messed things up pretty badly is:
hidden link

May 16, 2024 at 10:08 am #15634294

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Did you upload the csv files to the Media library.

When I download them they're not right, the whole content is on a single line with no rows, so something went wrong with that.

Better to use something like Wetransfer to share the original CSV files, I think.

May 16, 2024 at 11:17 am #15634690

basW-8

I think this will work better than the media thing:
hidden link

May 16, 2024 at 4:36 pm #15636263

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

OK, I can open those, but they are not what I was expecting at all.

We had previously been talking about using the WooCommerce product import tool to import products along with product categories.

These new CSV files you shared just have Categories, but no products, and a lot of the rows are empty, with no values for the Categories, though they do have language information.

You also have the WP All Import plugin, are you using that now instead of the WooCommerce import tool?

Sorry to go backwards, but it seems like we need to clarify what we are trying to do and what the problem is again.

Going back over this thread, my understanding is

1. your site had English products (imported)
2. you translated these products to Dutch
4. you added product categories in English
3. you translated the product categories to Dutch

At this point the categories are not assigned to the products, in either language.

Rather than assign them within the WordPress UI you prefer to use a spreadsheet to assign them.

So,
5. you exported the Dutch products and the English products
6. in the spreadsheet you added the product categories to the products (Dutch categories to Dutch products, English categories to English products. From your description it sounds like you handled both languages in the same CSV file.)
7. you imported this spreadsheet, and then you ran the WPML Export & Import wizard to set the language information

That's when you encountered problems. Rather than the categories being assigned as intended, some of them were duplicated.

Assuming all of the above is correct, I'm not sure what these latest CSV files you shared are for. If the intention is to connect categories to products, then the CSV file should contain both the products and the categories.

Screenshot 2024-05-16 at 16.22.43.png
May 22, 2024 at 5:43 am #15653326

basW-8

Your assumption is totally correct. I am using a csv to connect categories to products.
I tried to keep the csv as clean as possible (so just a product ID, category and WPML info) to avoid issues.
The empty rows are the variations of a variable product. They inherent the product category of the parent so no need to assign a category to them.

And we have used this method in other sites (without WPML) as well where it worked fine. But with WPML we keep getting an issue with duplicate categories.

One thing I can think of is that is can not handle "the same" names. For example under "brands" (english) and "merken" (dutch), we have brand names that are identical. If that would be the case that would be a serious issue, because we can not change those names.

May 22, 2024 at 11:17 am #15657588

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

What you are aiming to do isn't what the WPML Export & Import plugin is designed for, and after further testing I can confirm that it is the wrong tool for this job, and it's not needed. You should remove the plugin.

If the purpose of exporting and importing CSV files is to simply connect the products with the relevant product categories, across each language, then you should only export the products in the default language.

Specifically
- export the products in the default language
- edit the CSV to add the product categories in that language
- import that CSV file, overwriting the existing products

That's it. That will connect the product categories to the products in the default language.

If in WPML > Settings > Posts and pages synchronization you have the option "Copy taxonomy to translations" checked, that should also connect the translations of the product categories to the translations of the products.

If you don't have that setting checked, you can always go to WPML > Support and follow the link to the Troubleshooting page, and then run the batch process to "Synchronize post taxonomies" for Products.

I wasn't specifically testing variable products, but I expect the same result.

The topic ‘[Closed] Issue with import of categories in secondary language’ is closed to new replies.