Skip Navigation

[Resolved] WooCommerce archive pagination is not working properly.

This support ticket is created 3 years, 11 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+01:00)

This topic contains 13 replies, has 2 voices.

Last updated by Himanshu Agarwal 3 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1619335

Hello

We have created a WooCommerce archive page with toolset.

We are also using some taxonomy filters, custom field filter and also enabled pagination.

We have two problems or conflict in woocommerce archive page.

Issue 1. Ajax pagination is not working:

We have enabled "Pagination enabled with manual transition and AJAX" and also "Update the URL of the page when paginating the WordPress Archive" unchecked, but when we click on pagination its still reloading the page and changing the URL. Please help us to solve this.

Issue 2. Pagination is not working fine with filters.

When archive page (woocommerce shop page) load a full pagination load with all available option. We have enabled items per page to 24 so its showing 24 products when load.

But when we select a category from taxonomy filter that has only 4 items (products), pagination is still showing all option. When there is not enough items greater than the limit per page, pagination should be disabled or hidden.

How can we solve this problem that pagination should be hidden if there is no items available after taxonomy filter or any other filter?

Please help us to solve these two issues.

Thank You

#1619987

Nigel
Supporter

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

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

I think the problem is that the pagination controls you see and are clicking on are not added by the custom archive created with Toolset, but are output by your theme or by WooCommerce.

I just tested the manual pagination updating via ajax where the URL is not updated and it worked correctly, and if there were fewer results available (because of a taxonomy filter applied) then this was also correctly reflected in the pagination controls, but the pagination controls output by Toolset.

You will likely find that pagination controls are added by WooCommerce inside a nav element with class="woocommerce-pagination", so you can use CSS to hide those pagination controls and rely solely on the pagination controls you add to the custom archive with Toolset.

#1620739

Thank You Nigel for your reply.

Please help us to solve this problem that how can we output of pagination with toolset not by woocommerce or theme.
or
Is there any script that we can add for hiding pagination control if further items are not available?

Please help us to solve this problem with a solution.

Thank You.

#1621519

Nigel
Supporter

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

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

Sorry for the delay getting back to you, I'm running out of time today, I will share a CSS fix with you in the morning.

#1622639

Nigel
Supporter

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

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

As I mentioned before, the default WooCommerce controls are added in a nav item with a class of woocommerce-pagination, so you can hide them by adding the following CSS to your custom shop archive:

.woocommerce-pagination {
    display: none;
}

Don't forget to add Toolset pagination controls in the Search and Pagination section.

#1622795

Thank you Nigel for your reply.

I tried as you said.

With you solution the ajax loading problem is solved, I mean item are loading via ajax now.

When we select a category from taxonomy filter that has only 4 items (products), pagination is still showing all option. When there is not enough items greater than the limit per page, pagination should be disabled or hidden."

But this problem is solved. I mean there is no item after taxonomy filter and still pagination controls are showing, its not even disabled or not hidden.

Please help us to solve this problem also.

Thank you.

#1622807

Nigel
Supporter

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

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

Do you have a link where I can see this?

It doesn't happen on my own site and shouldn't be happening on yours, it would help if I could visit the page which shows the problem.

#1622815

Okay.

This need to be you make next reply private because site is protected.

#1622819

Nigel
Supporter

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

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

Sure, there you go.

#1622825

[redacted]

#1622851

Nigel
Supporter

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

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

Screenshot 2020-05-13 at 13.49.55.png

There are quite a few errors on that page unrelated to Toolset, though they could impact on anything that requires JavaScript (including pagination and search via ajax), see the screenshot.

I can't tell from the front-end alone what the cause of the problem is, could I get access to the back-end?

#1623679

[private]

#1623891

Nigel
Supporter

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

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

Thanks for that. I checked your site and I can see that you added the shortcode to generate the navigation controls in the Output Editor at the end of the custom archive.

The pagination controls must be inserted either in the Search and Pagination editor or in the Loop Editor (before the closing wpv-layout-end shortcode).

By placing the pagination controls outside of these editors, the pagination links do not respond to other changes in the archive query, such as when you apply a search filter.

#1623963

After adding pagination controls in the Loop Editor pagination is working fine.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.