WooCommerce Price Filter – Trigger When Slider Changes

0
148

So that when filtering prices in the WooCommerce CMS online store of the WordPress standard filter system, automatic filtering occurs without clicking a button, you can insert this js code into the file with js scripts of your theme:

jQuery( document ).ready(function($) {
    var priceSliderElements = $('.price_slider');
    var priceFilterFormSubmit = $('.widget.woocommerce.widget_price_filter .button[type="submit"]');
    priceSliderElements.on('click', function() {
        priceFilterFormSubmit.click();
    })
});

As a result, when you change the price filter in WooCommerce, products will be automatically filtered.

LEAVE A REPLY

Please enter your comment!
Please enter your name here