Skip Navigation

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

Problem:
Custom fields were not available for translation.

Solution:
- Set the required custom field's translation preference to translate or copy as required from wp-admin -> WPML -> Settings -> Custom Field Translation

- If you don't find the field there click on "Show System Fields" just below the "Custom Field Translation" heading.

- Edit and update the page with the issue in primary language.

Relevant Documentation:
https://wpml.org/documentation/getting-started-guide/translating-custom-fields/

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.

This topic contains 4 replies, has 2 voices.

Last updated by Dan 1 year, 5 months ago.

Assisted by: Subash Chandra Poudel.

Author Posts
July 4, 2023 at 2:18 pm #13942235

Dan

Hello Carlos,
what is the best way to have the custom variables (used by plugins) of those WooCommerce product variations in the screenshot: Cost, Up-Sells and Cross-Sells copied to all other languages?
Just like the other variables with the 🔒-symbol.

This the HTML surrounding the Cost-Variable:

<p class="form-field variable_alg_wc_cog_cost_0_field form-row form-row-full">
<label for="variable_alg_wc_cog_cost_0">Cost (excl. tax) (€)</label><input type="text" class="short wc_input_price" style="" name="variable_alg_wc_cog_cost[0]" id="variable_alg_wc_cog_cost_0" value="199" placeholder=""> <span class="description">Profit: <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">€</span> 216,83</span> (108.96%)</span></p>

This the HTML surrounding the Upsell-Variable:

<p class="upsells_variations form-field variations_upsell_ids[0][]_field">
<label for="variations_upsell_ids[0][]">Up-Sells</label>
<span class="woocommerce-help-tip" tabindex="0" aria-label="Up-Sells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive."></span> <select multiple="" style="" id="variations_upsell_ids[0][]" name="variations_upsell_ids[0][]" class="wc-product-search widefat select2-hidden-accessible enhanced" tabindex="-1" aria-hidden="true">
</select><span class="select2 select2-container select2-container--default" dir="ltr" style="width: auto;"><span class="selection"><span class="select2-selection select2-selection--multiple" aria-haspopup="true" aria-expanded="false" tabindex="-1"><ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"><li class="select2-search select2-search--inline"><input class="select2-search__field" type="text" tabindex="0" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" placeholder="" style="width: 0.75em;"></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>
</p>

Thank you!
Dan

screenshot_08.png
July 4, 2023 at 6:09 pm #13944497

Subash Chandra Poudel

Hi Dan,

First of all to ensure the quickest and most accurate support, please provide your debug information so that I can get a look at some of your configurations. You can find it in WPML > Support > click on “Debug information” link. Please check this link for more info: http://wpml.org/faq/provide-debug-information-faster-support/

Now, regarding the fields in the screenshot it looks like they are custom fields, can you please go to WPML -> Settings -> Custom Field Translation and set those fields to Copy or Translate as required as explained in the next document and see if it helps?

https://wpml.org/documentation/getting-started-guide/translating-custom-fields/

If you don't see those custom fields there, try clicking on the "Show System Fields" just below the "Custom Field Translation" heading then try searching for Upsell, cost and see if you find those fields.

IMPORTANT: Please make sure to backup the site completely first or test this on a staging/test site to prevent any issues.

July 6, 2023 at 6:47 pm #13962875

Dan

Subash, thank you for pointing out the Show System Fields option. This helped me find the custom fields and mark them for copy.
After saving the product page the fields also got correctly synchronized.

I also added the custom fields to my wpml-config.xml in my child theme. Then custom fields appear with a 🔒-sign on the "Setting" page, but not yet on the product pages.

What is the trick to have custom fields marked as copy appear with the🔒-sign on the product page too?

July 7, 2023 at 4:45 pm #13969607

Subash Chandra Poudel

Hi Dan,

Thank you for confirming the issue is resolved now.

The default product fields are locked with a custom feature from WCML. However this is not yet available for other fields so No, the custom field cannot be locked for the translations.

Regards,
Subash