Skip Navigation

Resolved

Reported for: WooCommerce Multilingual & Multicurrency 5.2.1

Resolved in: WCML 5.3.3

Topic Tags: Bug

Overview of the issue

If you are using WooCommerce Multilingual, you may experience a 504 Gateway Time-out error when attempting to update product with variations on your website.

Workaround

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 );
    	}