Skip to content Skip to sidebar

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
- 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 -
- 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 -

Supporter timezone: Asia/Kathmandu (GMT+05:45)

This topic contains 16 replies, has 1 voice.

Last updated by Shekhar Bhandari 4 months, 3 weeks ago.

Assisted by: Shekhar Bhandari.

Author Posts
December 15, 2025 at 9:18 am #17663198

nicolaiL-2

Hello Shekhar,

Thanks for the update. I have updated plugin code to not use variation id in field and save data and updated code to reflect on front side. I also updated wpml config file in plugin to use updated field. Still its not working. The updated filed now is

Creating field
$meta_key = 'product_side_variation_image_' . $index;
$image_id = get_post_meta( $variation->ID, $meta_key, true );

Saving field
$meta_key = 'product_side_variation_image_' . absint( $index );
update_post_meta( $variation_id, $meta_key, absint( $image_id ) );

Wpml config
<custom-field action="copy">product_side_variation_image_*</custom-field>

Still not duplicating / copying for translation.

December 15, 2025 at 9:21 am #17663206

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Can you go to WPML->Settings->Custom fields translations and check if the fields are set to copy? If not you will need to run the script or manually set the fields as copy.

If it doesn't work, please provide me the product url so I can check.

Thanks

The topic ‘[Closed] I need help with proper code to make my custom fields copy when adding translation’ is closed to new replies.