Skip Navigation

[Resolved] Split: pagination issue with product View when using product filter plugin

This support ticket is created 5 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 8 replies, has 2 voices.

Last updated by Nigel 5 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1220838

Hello Nigel,

Actually I've come up with my own solution 🙂

This is what I did, it's pretty simple. I've used Taxonomy based view (show only subcategories of that parent category where view is shown) and Products View (show products from that category). It was pretty simple.

But now I have another problem. Please watch my video I posted below:
hidden link

Best,
Ivan

#1220841

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ivan

I've split this into another thread, as it looks like a specific issue where there may be a conflict between your product filter plugin and Views.

First, which is the plugin? This one? https://wordpress.org/plugins/woocommerce-products-filter/ Or another?

If you disable the plugin, does the pagination work correctly?

I visited your site on the front end and noticed "AJAX Failsafe active" messages in the console which suggest that the plugin could be interfering with the ajax requests from Views.

But, in any case, I'm not sure you can expect the plugin to work with Views, I'd need to know more about the plugin. If you create a View that queries products then I wouldn't expect a 3rd party plugin to update the query arguments for that View, but I would need a closer look at how it works.

#1220941

Hello Nigel,

Plugin name: WooCommerce Product Filter

This is the plugin -> hidden link
It is bought from Envato Market/CodeCanyon, here's the link: hidden link

I've deactivated the plugin now and pagination is still having the same issues. Can you please make my next answer private so I can provide you with website credentials?

Best regards,
Ivan

#1220973

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Yes, here you go...

#1221757

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ivan

I need to take a copy of your site to do some deeper testing locally.

Your set-up is a little odd because you are using the archive pages but not using the archive results on that page, you are using a Beaver Themer design for the archive page and inserting Views to effectively reproduce the archive query, and its the pagination for that View isn't working.

I need to do some checks to see if I can isolate why, and reproduce on another site if needs be.

I've taken a copy and I'll update you again with the results of the testing.

#1221833

Hello Nigel,

If my approach to that solution is bad, than I can have the same looking for category archive page done on another way, it's not a problem to have a different approach, I just need to have the same output one the frontend.

Thanks a lot.

Best,
Ivan

#1222448

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hello Ivan

I'm not too familiar with Beaver Themer and the various Beaver extensions you have, and I don't have the time to dig deeply to see exactly how they are working on your site.

Instead I have created a demo site for you to see how this works without the distraction of Beaver, and I'll leave it to you to weave Beaver back into the mix.

So, here is the site: hidden link

You can log in to the admin pages with that link, no username/password required.

Now, I imported the sample WooCommerce content for the purposes of the demo.

I'm not worried about the design, just setting the workflow up with simple links.

If you visit the home page you will see it includes a View to display links to the top-level product categories.

On this demo site, only clothing has sub-categories, so test with that link.

That will take you to a custom archive for product categories.

At the top I have inserted another View, this time to display links to the sub-categories.

Beneath that appears the results of the archive, i.e. the list of matching products. Importantly, this is the WordPress archive for product category results itself, i.e. the main query on this page, not some other View we added with a custom query.

You'll note the pagination links. I've added Views pagination links, and I have left the theme pagination links.

They both work, but there are important differences.

The theme pagination links are "standard" pagination links, so they will work nicely with other 3rd party products, where relevant.

So why bother with Views pagination links at all? Well, you would need to if you are using Views custom search filters. The theme pagination isn't aware of them, and the standard pagination won't respect the filter results.

But if you are not using Views search filters, then you could just use the theme pagination links.

I also installed your product filter plugin and added its widget (to the footer).

You should be able to see that, because we are displaying products through the main query for the archive page and not some custom Views query, then its filters work. And, they work in combination with the theme's pagination links.

But they don't work with the Views pagination links, which is expected.

Now, you have issues with Views pagination links on your site even when the filter plugin is disabled, but I think that is to do with how you have set this up, including using Beaver to generate the archive.

If you study my sample site to see it working I think you should be armed with enough to try and implement the same on your site, even with Beaver, but if you run into a specific, replicable issue where Beaver (or one of the various extensions) breaks the pagination, then let me have the details and if I can reproduce I can escalate for it to be debugged and fixed.

#1222510

Hello Nigel,

My client changed their mind and they want another look of those category archives and I've made a video with explanation of all of it, I've prepared most of it but now I'm stuck, can you please watch it and help me out?
Link: hidden link

Best,
Ivan

#1223041

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

So it seems like the change in requirement is just to not show any products until we have navigated to the lowest level of the product category taxonomy.

I've updated my demo site for that.

Check the output editor of the product category custom archive, where I use a custom shortcode child-terms in a conditional.

That shortcode is registered like so:

add_shortcode('child-terms', function () {

    global $wp_query;
    $obj = $wp_query->get_queried_object();

    $term_children = get_term_children($obj->term_id, $obj->taxonomy);

    return count($term_children);

});