PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

[ SOLVED ] How to make Price Range Filter to Work with " Product Variations "

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Happy to say that implementing this solution at . . .

https://github.com/woocommerce/woocommerce/issues/24349#issuecomment-552185808

https://github.com/mensmaximus/woocommerce/commit/38c507dc60c3d1e7762d153ce804f915f70ec1f5?branch=38c507dc60c3d1e7762d153ce804f915f70ec1f5&diff=split

WORKS !

============

Please let me know if there is a way for you to integrate this solution into your plugin .

After all this research ( about 30 hours )  I really hope so .

Look forward to your reply.

Open the WooCommerce file found at . . .

includes/class-wc-query.php

=========

CHANGE FROM :

}

$args['join'] = $this->append_product_sorting_table_join( $args['join'] );
$args['where'] .= $wpdb->prepare(
' AND wc_product_meta_lookup.min_price >= %f AND wc_product_meta_lookup.max_price <= %f ',
$current_min_price,
$current_max_price
);
return $args;
}

/**
* Handle numeric price sorting.


CHANGE TO :

}

$args['join'] = $this->append_product_sorting_table_join( $args['join'] );
$args['where'] .= $wpdb->prepare(
' AND ( wc_product_meta_lookup.min_price >= %f AND wc_product_meta_lookup.max_price <= %f )
OR ( wc_product_meta_lookup.max_price <> wc_product_meta_lookup.min_price
AND NOT ( wc_product_meta_lookup.max_price < %f OR wc_product_meta_lookup.min_price > %f ) ) ',
$current_min_price, $current_max_price, $current_min_price, $current_max_price
);
return $args;
}

/**

* Handle numeric price sorting.

 

=========

IMPORTANT:

The only issue with this modification is that it MIGHT get overwritten when you update the WooCommerce plugin .

So if there is a way to implement this into a future release of WOOF, please let us know .

Look forward to your reply.

 

 

..

Hello

Thank you  for  cooperation!

Our price search is powered by woocommerce price search

If you get a chance, please bring this to WooCommerce's attention.

Not likely to listen to me.

But more likely from you.

 

You're welcome for the assist.

Glad to help.

Hello

Ok!  But I doubt that there will be a positive result