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.

Tagged: 

This topic contains 29 replies, has 2 voices.

Last updated by Long Nguyen 1 year, 6 months ago.

Assisted by: Long Nguyen.

Author Posts
June 1, 2023 at 3:07 pm #13755853

peterJ-48

Hello,

1. Delete the current shipping classes > Create new shipping classes > Assign them to products and translate products.

2. Or access your database, run the query below:
DELETE FROM `wp_icl_translations`
WHERE `element_type` = 'tax_product_shipping_class';

Reply : The first and second option as you suggested is not feasible for me, as we have a lot of products.

June 2, 2023 at 1:14 am #13758173

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Then you can try the second workaround to run the query and translate your products automatically from WPML > Translation Management as you shared in the video hidden link

The query deletes the language of the shipping class and prevents duplicating the shipping class. You only need to run it at once.

June 2, 2023 at 6:14 am #13758419

peterJ-48

Hello,

If i run this query " DELETE FROM `wp_icl_translations` WHERE `element_type` = 'tax_product_shipping_class'; "
Then all shipping classes will be removed ( default language also ).
Then I have to create new shipping classes and then assign the products and translate the products.
It is not feasible for me, as I say we have many products.

June 2, 2023 at 6:40 am #13758505

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

The shipping classes are not deleted if you run the query. What will be deleted here is the language of the shipping classes: rows in the table wp_icl_translations, not rows in the table wp_terms.

If you want to test, try it on the sandbox site that I shared before:
hidden link

June 2, 2023 at 3:12 pm #13762553

peterJ-48

Hello,

We execute this query: " DELETE FROM `wp_icl_translations` WHERE `element_type` = 'tax_product_shipping_class'; "

After executing this query all translated shipping classes except the default language have been removed.
Then i have automatically translated the product. Then I noticed after auto translate product that translate shipping classes are automatically generated, and i have set "not translate shipping classes" option in wpml setting.
Still i'm facing same issue as i mention in this video : hidden link

shipping.png
setting.png
June 5, 2023 at 1:44 am #13767005

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

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 a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: 
https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme and to change configurations on the site if needed. This is also a reason the backup is critical.

June 6, 2023 at 1:55 am #13774845

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I think you've run an incorrect SQL query because the database prefix is "www0_" so the query should be:

DELETE FROM `www0_icl_translations` 
WHERE `element_type` = 'tax_product_shipping_class';

Now you can translate your products again and see how it goes. Here is a screen record I test to translate a product on your site hidden link
the shipping class is not duplicated.

Look forward to your reply.
Thanks

June 6, 2023 at 8:04 am #13775701

peterJ-48

Hello,

We already replaced " wp_ " to " www0_ " database prefix.

We already run this query : DELETE FROM `www0_icl_translations` WHERE `element_type` = 'tax_product_shipping_class';

After executing this query all translated shipping classes except the default language have been removed.

Then i have automatically translated the product. Then I noticed after auto translate product that translate shipping classes are re-generate, and i have set "not translate shipping classes" option in wpml setting.

And as you send me screen record for translate a product on my site but i can't see anything on this : hidden link

And after your troubleshooting, I can't see default language (English) shipping class "sc12" on the Woocommerce > setting > shipping > Shipping classes, I can see only one shipping class "sc12" and is have a translated (Find the screenshot).

sc12.png
June 6, 2023 at 8:52 am #13776507

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

As I mentioned in the workaround https://wpml.org/forums/topic/after-updated-newest-version-of-wpml-we-are-facing-issue-with-shipping-classes/page/2/#post-13751457
you should set the taxonomy "Product shipping classes" preference to Not Translatable before running the SQL query.
Now you can try to translate the product and let me know how it goes.

Regarding the shared screen record, I see it works properly, please check this screenshot hidden link

Regarding the shipping class SC12, I've tried to delete the translation shipping classes and could delete the main shipping class, sorry about that. If you have a backup of your site, please restore it to get the shipping class back.

Look forward to your reply.
Thanks

June 6, 2023 at 2:12 pm #13779523

peterJ-48

Hello,

First, I imported my backup and then tried to run the above query, then I checked that the secondary shipping classes were not deleted.
Please check this video link : hidden link

June 7, 2023 at 1:33 am #13781813

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

As I mentioned in two replies above:

The shipping classes are not deleted if you run the query: DELETE FROM `www0_icl_translations` table. What will be deleted here is the language of the shipping classes: rows in the table wp_icl_translations, not rows in the table wp_terms.

If you want to delete the duplicated shipping classes, please delete them manually and save changes.

Regards.

June 7, 2023 at 5:48 am #13782015

peterJ-48

Hi,

Okay,
I'll try to remove those duplicate shipping classes manually, and then run that query, let's see if the shipping classes regenerate after I do the auto-translate.

Because, " thread reply : https://wpml.org/forums/topic/after-updated-newest-version-of-wpml-we-are-facing-issue-with-shipping-classes/page/2/?bbp_reply_to=13762553&_wpnonce=510f057173#new-post " when first-time did run this query then duplicate shipping classes remove, and then after i did auto-translation then duplicate shipping classes re-generate.

June 7, 2023 at 8:23 am #13782911

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I'm waiting for your feedback.

Thanks.

June 20, 2023 at 2:23 pm #13860529
peterJ-48

Hello,

After run this query ( DELETE FROM `www0_icl_translations` WHERE `element_type` = 'tax_product_shipping_class'; ), we face issue in the breadcrumb, The Yoast Breadcrumb not showing translation product.
Product Link : hidden link

New threads created by Long Nguyen and linked to this one are listed below:

https://wpml.org/forums/topic/yoast-seo-breadcrumb-does-not-work-on-translation-page/

Screenshot_41.png
Screenshot_40.png
June 21, 2023 at 3:13 am #13863563

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

We can handle one issue per ticket only so I will split your new question/issue into a new ticket. If you see the main issue with the duplicate shipping class is resolved, please mark this ticket as Resolved.

Thanks.