This thread is resolved. Here is a description of the problem and solution.
Problem:
I want to show the related product section on the translation product page. This section is created by the plugin "Custom Related Products for WooCommerce".
Solution:
1. Go to WPML > Settings > Custom Fields Translation section > Click on "Show system fields" > Search for the field "_related_ids" > Set the preference to "Translate".
2. Add the code below to the file functions.php in the theme/child theme folder to translate the numeric value in Advanced Translation Editor (ATE).
function wpmlsupp_7499_allow_translating_numbers( $is_translatable, $job_translate ) { $data = $job_translate['field_data']; if ( 'base64' === $job_translate['field_format'] ) { $data = base64_decode( $data ); } if ( is_numeric( $data ) ) { return true; } return $is_translatable; } add_filter( 'wpml_tm_job_field_is_translatable', 'wpmlsupp_7499_allow_translating_numbers', 10, 2 );
3. Edit the product in the original language > Click on Update > Update the translation in ATE.
4. Search for the related product ID number and translate it with the translation product ID. Please check the screenshot attached.
❌ IMPORTANT: Please backup your database and website before proceeding ❌
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 1 year, 5 months ago.
Assisted by: Long Nguyen.