Skip Navigation

Resolved

Reported for: WooCommerce Multilingual & Multicurrency 4.11.6

Resolved in: 4.12.0

Overview of the issue

WooCommerce provides you a Filter by price widget that allows your users to easily filter your products.

Currently, if you are using our multicurrency feature, you will notice that in secondary currencies, the min and max values display correctly, however, the filter uses the prices from the default language. This causes it to display the wrong results.

Workaround

Before proceeding, make a full backup of your site. Then:

  1. Open your WooCommerce Multilingual folder.
  2. Find  /woocommerce-multilingual/inc/currencies/class-wcml-multi-currency-prices.php file.
  3. Go to line 620.
  4. Change:
    $args['where'] = str_replace( $wpdb->prepare( 'wc_product_meta_lookup.min_price >= %f', $min_price ), $wpdb->prepare( 'wc_product_meta_lookup.min_price >= %f', $min_price_in_default_currency ), $args['where'] );
    $args['where'] = str_replace( $wpdb->prepare( 'wc_product_meta_lookup.max_price <= %f', $max_price ), $wpdb->prepare( 'wc_product_meta_lookup.max_price <= %f', $max_price_in_default_currency ), $args['where'] );
    [/code]
    
    With:
    
    $args['where'] = str_replace( $wpdb->prepare( '%f<wc_product_meta_lookup.min_price', $max_price ), $wpdb->prepare( '%f<wc_product_meta_lookup.min_price', $max_price_in_default_currency ), $args['where'] );
    $args['where'] = str_replace( $wpdb->prepare( '%f>wc_product_meta_lookup.max_price', $min_price ), $wpdb->prepare( '%f>wc_product_meta_lookup.max_price', $min_price_in_default_currency ), $args['where'] );