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?
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.
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.
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.
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.
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?
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.