WPML

Overview of the Issue

When using the multicurrency option from WPML Multilingual & Multicurrency for WooCommerce, you might experience the following issue:

If the option “Show only products with custom prices in secondary currencies” is enabled, variable products do not display the currency switcher, even when all variations have custom prices set in the secondary currency.

Workaround

This issue is fixed in WPML Multilingual & Multicurrency for WooCommerce 5.5.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 site backup of your site before proceeding.

  • Open the …/wp-content/plugins/woocommerce-multilingual/inc/currencies/currency-switcher/class-wcml-currency-switcher.php file.
  • Look for line 353.
  • Replace:
    if ( $product && $product->is_type( 'grouped' ) ) {
    	foreach ( $product->get_children() as $child_id ) {
    		if ( ! $hasOriginalCustomPrices( $child_id ) ) {
    			return false;
    		}
    	}
    } else {
    	if ( ! $hasOriginalCustomPrices( $currentProductId ) ) {
    		return false;
    	}
    }
  • With:
    if ( $product && $product->is_type( 'grouped' ) || $product->is_type( 'variable' ) ) {
    	foreach ( $product->get_children() as $child_id ) {
    		if ( ! $hasOriginalCustomPrices( $child_id ) ) {
    			return false;
    		}
    	}
    } else {
    	if ( ! $hasOriginalCustomPrices( $currentProductId ) ) {
    		return false;
    	}
    }

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.

Ask a support question

All known issues