Page numbers don’t get refreshed on AJAX calls

Our plugin supports the standard WooCommerce pagination containers of woocommerce-pagination class. If you theme renames the pagination containers, or places them outside of the products list wrapper, the filters will fail to detect them during AJAX updates.

If you have the annasta Filters > Product lists > Force wrapper reload option disabled and noticed that page numbers do not refresh on AJAX filters’ application, please follow the checklist below:

1. Make sure that the containers of class “woocommerce-pagination” are the children of the products list HTML wrapper (click here to read about locating the HTML wrapper). If the wrapper does not encapsulate the “woocommerce-pagination” containers, assign a higher level wrapper in the Products HTML wrapper setting, so that the HTML wrapper would include the “woocommerce-pagination” containers as well as the products list (the “products” class) container.

2. If your theme maintains the standard WooCommerce architecture, but changes the class of its pagination containers, you can resolve this by declaring the needed custom pagination selector using one of the 2 methods:

a. If you use your own custom theme or a child theme, customize the pagination selector (add your own in place of ‘.pagination’) with the help of the filter added to the functions.php file:

function customize_annasta_pagination_container( $js_data ) {
  $js_data['pagination_container'] = '.pagination';
 
  return $js_data;
}
add_filter( 'awf_js_data', 'customize_annasta_pagination_container' );

OR

b. Add the following JavaScript in annasta Filters > Plugin settings > Custom JavaScript box or anywhere else it may suit you:

jQuery( document ).ready( function( $ ){
  if( typeof( awf_data ) !== 'undefined' ) {
      awf_data.pagination_container = '.pagination';
  }
});

Replace the ‘.pagination’ selector with the one relevant to your theme.