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 3 replies, has 2 voices.

Last updated by Bigul 3 months, 4 weeks ago.

Assigned support staff: Bigul.

Author Posts
June 20, 2019 at 11:36 am #4059515

laurenceC-6

See this thread, its happened again?
https://wpml.org/forums/topic/color-swatches-not-saving-with-wpml-string-translation-translation-management/#post-4059401

Default language products is OK:
hidden link

All other languages missing some swatches:
hidden link

June 20, 2019 at 1:26 pm #4060175

laurenceC-6

For info, the data is initially stored in the database by the Variation and Swatches and Photos, but then gets replaced.

I know this because in the file woocommerce-variation-swatches-and-photos/classes/class-wc-swatches-product-data-tab.php I outputted the data to the screen and I added a die() command right after $product->save_meta_data(). I then checked the database the correct swatches data was saved. So this plugin is doing its job.

But if I remove the die, so let the full page processing happen, the data gets removed. Something in WPML is removing it.

Data that should be saved:

a:2:{s:32:"296cc9a02b167493f6ff885c48ca71ff";a:4:{s:4:"type";s:14:"product_custom";s:6:"layout";s:7:"default";s:4:"size";s:19:"swatches_image_size";s:10:"attributes";a:3:{s:32:"30bcfdf5612252c657f44ee97f93c7b9";a:3:{s:4:"type";s:5:"color";s:5:"color";s:7:"#7d407d";s:5:"image";s:1:"0";}s:32:"1ffd9e753c8054cc61456ac7fac1ac89";a:3:{s:4:"type";s:5:"color";s:5:"color";s:7:"#FFFFFF";s:5:"image";s:1:"0";}s:32:"0ed64578cb55e7398f65a78d11cbadd4";a:3:{s:4:"type";s:5:"color";s:5:"color";s:7:"#FFFFFF";s:5:"image";s:1:"0";}}}s:32:"fc0114a802d5d44d316f4833465e0751";a:4:{s:4:"type";s:14:"product_custom";s:6:"layout";s:7:"default";s:4:"size";s:19:"swatches_image_size";s:10:"attributes";a:2:{s:32:"1ffd9e753c8054cc61456ac7fac1ac89";a:3:{s:4:"type";s:5:"color";s:5:"color";s:7:"#FFFFFF";s:5:"image";s:1:"0";}s:32:"5b2d4484498235e80d61a233a7c04991";a:3:{s:4:"type";s:5:"color";s:5:"color";s:7:"#FFFFFF";s:5:"image";s:1:"0";}}}}

Data that gets saved after further processing by something in WPML:

a:2:{s:32:"296cc9a02b167493f6ff885c48ca71ff";a:4:{s:4:"type";s:14:"product_custom";s:6:"layout";s:7:"default";s:4:"size";s:19:"swatches_image_size";s:10:"attributes";a:0:{}}s:32:"fc0114a802d5d44d316f4833465e0751";a:4:{s:4:"type";s:14:"product_custom";s:6:"layout";s:7:"default";s:4:"size";s:19:"swatches_image_size";s:10:"attributes";a:0:{}}}
June 20, 2019 at 1:35 pm #4060243

laurenceC-6

If I comment out this line in woocommerce-multilingual/compatibility/class-wcml-variation-swatches-and-photos.php

then it allows us to save the colours fine. So your class-wcml-variation-swatches-and-photos.php is still not working right.

//update_post_meta( $trnsl_product_id, '_swatch_type_options', $tr_atts ); // Meta gets overwritten.

June 21, 2019 at 9:35 am #4065891

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve these issues.

Please fill the private details fields after a full site backup. I would like to access the admin area of your site for further checking.

Please check the following links for more details about our private information sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

Please allow me to make a duplicator copy of your site using the Duplicator plugin(https://wordpress.org/plugins/duplicator/) for debugging the issue on my local server.

--
Thanks!

Bigul

The topic ‘[Closed] Swatch colours missing again’ is closed to new replies.