Forums › Forums › Search & Filter Pro › Pagination in Woo commerce issue
Tagged: woocommerce pagination
- This topic has 2 replies, 2 voices, and was last updated 8 years, 9 months ago by Anonymous.
-
Anonymous(Private) February 9, 2016 at 1:51 pm #36551
Hi,
First off the plugin is amazing!
We have a woocommerce store here – http://officialwatch.staging.wpengine.com/our-watches
You will see the pagination 1 – 143 pages which is correct, we are seeing the issue when you click on a page number, for example page 4 the total number reduces to 7? we are also seeing that the active state is not being updated sometimes as well.
We are using the woocommerce default pagination code:
<?php /** * Pagination - Show numbered pagination for catalog pages * * This template can be overridden by copying it to yourtheme/woocommerce/loop/pagination.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer). * will need to copy the new files to your theme to maintain compatibility. We try to do this. * as little as possible, but it does happen. When this occurs the version of the template file will. * be bumped and the readme will list any important changes. * * @see http://docs.woothemes.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates * @version 2.2.2 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } global $wp_query; if ( $wp_query->max_num_pages <= 1 ) { return; } ?> <nav class="woocommerce-pagination"> <?php echo paginate_links( apply_filters( 'woocommerce_pagination_args', array( 'base' => esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) ), 'format' => '', 'add_args' => '', 'current' => max( 1, get_query_var( 'paged' ) ), 'total' => $wp_query->max_num_pages, 'prev_text' => '←', 'next_text' => '→', 'type' => 'list', 'end_size' => 3, 'mid_size' => 3 ) ) ); ?> </nav>
Any help how to solve this would be great
ThanksSteve
Ross Moderator(Private) February 10, 2016 at 1:37 pm #36655Hey Steve
I see the issue.
When using ajax, the form actually submits and the pagination is appended to the URL.
The issue here is, when you form submits, so does the price range – so you’ll notice
_sfm__regular_price=1395+86895
is added to the URL.Because many of your posts, don’t have values within this range, the pagination for those kind of high numbers is incorrect.
I think its a case of just setting a price for all of your products, or changing the min/max values of the field.
In an ideal scenario S&F wouldn’t be adding the price to the URL automatically – its something I’ll have a look into.
Thanks
-
AuthorPosts