Not showing correct number of product after using sort
-
I developed a new theme for a customer and i’m having a problem which i can’t seem to solve.
What happens is, when on product archives or category archives, i set the theme to only show 8 products per page, with this litle code here:`add_filter( ‘loop_shop_per_page’, ‘new_loop_shop_per_page’, 20 );
function new_loop_shop_per_page( $cols ) {
// $cols contains the current number of products per page based on the value stored on Options –> Reading
// Return the number of products you wanna show per page.
$cols = 8;
return $cols;
}`So far so good, but everytime you use the default sort functionilty from WooCommerce it shows random number of products per page instead of showing the 8 i’m saying it to be.
You can see it happening here:
https://hiima-store.com/product-category/collection-en/I have infinite loading, so i thought it was the problem, which i removed, but the outcome is the same.
Also, the sort is not working correctly, like when you sort from price low to high, it doesn’t respect it at all.
Since the products were imported from another website, i went to clean transitients, regenerate product lookup tables, recount terms and update woocommerce database, in hopes it solve the problem, but it doesnt.
Anyone has any idea?
Thanks
- The topic ‘Not showing correct number of product after using sort’ is closed to new replies.