Home Forums WoodMart support forum Bug with “Products by Rating list” not using Permalink structure Reply To: Bug with “Products by Rating list” not using Permalink structure

#602812

barry-6678
Participant

temporary fix

jQuery(document).ready(function($) {
    function updatePriceFilterURL() {
        var priceFilterForm = document.querySelector('.widget_price_filter form');
        if (priceFilterForm) {
            priceFilterForm.action = priceFilterForm.action.replace('/product-category/', '/index.php/product-category/');
        }
    }

    // Run on page load
    updatePriceFilterURL();

    // Run on AJAX update
    $(document).on('updated_wc_div', function() {
        updatePriceFilterURL();
    });
});