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

Issue with Pagination When Changing Filters in WOOF Plugin

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.

Dear Support Team,

I hope this message finds you well.

I am experiencing an issue with the WOOF plugin related to pagination when filtering products.

Here’s the detailed problem:
1. I navigate to a specific product category and reach, for example, page 5.
2. I then change the filter to select a different category and click the “Filter” button.
3. After applying the filter, I am redirected to the new category but remain on page 5.
4. If the new category doesn’t have a page 5, I encounter an error or a blank page.

This behavior confuses users and disrupts the shopping experience.

Ideally, the pagination should reset to the first page every time a filter is applied.

Could you please advise if there is an existing setting to resolve this issue or provide guidance on how to address it?

Alternatively, do you plan to implement a fix in a future update?

Thank you for your assistance, and please let me know if you need further details or access to my site for debugging.

Looking forward to your response.

Best regards,
Chris

Hello Chris

Please drop me exact link to the issue

It looks like the problem is related to a custom template that has non-standard pagination.

Hello Pablo,

Thank you for your help.
Here's the link to te filter page : https://www.unjque.fr/boutique/
I'm using DIVI theme.

Best regards
Chris

Hello Chris

Please check file -\woocommerce-products-filter\ext\url_request\js\url_parser.js  - check if you have this code - https://share.pluginus.net/image/i20241125110556.png

    let all_vars = new URLSearchParams(vars);
    if (all_vars.has('product-page')) {
        all_vars.delete('product-page');
vars ="?" + all_vars;
    }

Hello Pablo,

Thank you so much for your valuable assistance and for the excellent quality of your plugin.

I’m pleased to inform you that the solution works perfectly. I added the following snippet at line 45 in the url_parser.js file:

// Add Snippet pagination
let all_vars = new URLSearchParams(vars);
if (all_vars.has('product-page')) {
all_vars.delete('product-page');
vars ="?" + all_vars;
}
// Removes the ‘?’ if all_vars is empty
if (all_vars.toString() ==="") {
vars ="";
}

The additional code to remove the ? at the end of the URL seemed like a useful improvement after I noticed that this symbol was consistently being added at the end of the URL when the pagination was reset. I thought it might be interesting to include this small snippet to ensure cleaner and more consistent URLs :

// Removes the ‘?’ if all_vars is empty
if (all_vars.toString() ==="") {
vars ="";
}

I’d like to know if this change will be included in the next update of the plugin or if I’ll need to reapply it manually after each plugin update ?

Thank you again for your invaluable help and for maintaining such a great plugin!

Best regards,

Chris

Hello Chris

Thank you for your cooperation!  I will pass your suggestion on to the developers.

Yes, this code will be included in the next version of the plugin.

Welcome;)