Overview of the Issue
If you are using WPML Multilingual & Multicurrency for WooCommerce, you may experience a 504 Gateway Time-out error when attempting to update product with variations on your website.
Workaround
This issue is fixed in WCML 5.3.3. Updating solves it on your site, so you only need this workaround if you can’t update yet.
Please, make sure of having a full backup of your site before proceeding.
- Open …/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-variations-data.php file.
- Look for line 219.
- Change:
public function get_variation_id_by_lang( $lang, $original_variation_id ) { return $this->wpdb->get_var( $this->wpdb->prepare( "SELECT post_id FROM {$this->wpdb->postmeta} AS pm JOIN {$this->wpdb->prefix}icl_translations AS tr ON tr.element_id = pm.post_id WHERE tr.element_type = 'post_product_variation' AND tr.language_code = %s AND pm.meta_key = '_wcml_duplicate_of_variation' AND pm.meta_value = %d", $lang, $original_variation_id ) ); } - For:
public function get_variation_id_by_lang( $lang, $original_variation_id ) { return apply_filters( 'wpml_object_id', $original_variation_id, 'product_variation', false, $lang ); }