[Resolved] How to register generic data for a WooCommerce product
This thread is resolved. Here is a description of the problem and solution.
Problem: You are experiencing issues with a custom checkbox field in WooCommerce products not saving its state across translations. You need the checkbox to be consistent for all languages and editable only for the original product. Solution: 1) Navigate to WPML-> Settings-> Custom Fields Translation section, search for your fields, and set them to Copy. 2) After setting the fields to copy, update the products in the default language and check if the field values are copied correctly. 3) We also recommend providing your Debug information to help us better understand your site configuration. You can find a detailed explanation on how to provide this information here.
If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket here.
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.
Background of the issue:
I'm having trouble with a custom checkbox field I've added to some of my WooCommerce products via custom code. The checkbox state isn’t saving across translations, and I want it to be consistent for all languages. The checkbox should only be editable for the original product, not for translations.
Symptoms:
The checkbox state isn't saving across translations in WooCommerce products.
Questions:
How can I ensure the checkbox state is consistent across all language translations?
How do I make the checkbox editable only for the original product and not for translations?
Thanks for contacting WPML forums support. I'll be glad to help you today.
First of all, sorry for the late reply; it was due to a higher workload.
1) Please go to WPML-> Settings-> Custom Fields Translation section, search for your fields, and set them to Copy.
After that, please update the products in the default language and check if the field values are copied correctly.
2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me much information about how your site is configured.
Unfortunately, your solution didn't resolve the issue. I believe I have correctly configured my custom fields in the WPML settings, but it hasn’t made any difference in the back office. The "base" product and its translations remain unsynchronized.
Could you assist me further in resolving this problem?
I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP) Preferably to a test site where the problem has been replicated.
Your answer will be private, meaning only you and I can access it.
❌ Please backup your database and website ❌
✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.
✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.
The custom field was set correctly, but you need to update the product in the default language in order to apply the new translation preference. Please check this hidden link">video.
Kindly let me know if this is the checkbox you need it to be copied.
I don't understand why it's not working when I test it on my side. It might be because I had already manually translated the product you chose to test your solution on.
Could you please try another product ?
You can try this one : Osmium tetroxide waste neutralizer.
Ideally I'd like the field to be "locked" like the on the screenshot below.