Quote from loko on November 4, 2020, 12:55
So on my archive.blade.php , I have woof implemented but I can't find a way to actually change the per_page nor the limit of products shown. Whenever I try to do it on the normal woocommerce way, it just ignores it. Like for example:
add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 999999 );
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 = 9;
return $cols;
}Doesn't do anything. It's still showing me like 30+ products. Even when I do for example a shortcode like this:
[woof_products per_page=8 columns=3 is_ajax=1 taxonomies=product_cat:9]
It just ignores it as well. This is just for testing. I don't actually want a shortcode. I want to change the default archive.blade.php limit/ per page, but it seems WOOF is just ignoring my code.
Next I tried to just edit woocommerce-products-filter/index.php by finding the "woof_products" function and add directly in there the per_page. I did and when I inspect my code in my browser, it looks like this:
<div id="woof_results_by_ajax" data-shortcode="woof_products taxonomies=product_cat:400 is_ajax=1 predict_ids_and_continue=1" per_page=5>
However it's still not showing 5 per page. What is going on here? I've tried so many things.
So on my archive.blade.php , I have woof implemented but I can't find a way to actually change the per_page nor the limit of products shown. Whenever I try to do it on the normal woocommerce way, it just ignores it. Like for example:
add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 999999 );
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 = 9;
return $cols;
}Doesn't do anything. It's still showing me like 30+ products. Even when I do for example a shortcode like this:
[woof_products per_page=8 columns=3 is_ajax=1 taxonomies=product_cat:9]
It just ignores it as well. This is just for testing. I don't actually want a shortcode. I want to change the default archive.blade.php limit/ per page, but it seems WOOF is just ignoring my code.
Next I tried to just edit woocommerce-products-filter/index.php by finding the"woof_products" function and add directly in there the per_page. I did and when I inspect my code in my browser, it looks like this:
<div id="woof_results_by_ajax" data-shortcode="woof_products taxonomies=product_cat:400 is_ajax=1 predict_ids_and_continue=1" per_page=5>
However it's still not showing 5 per page. What is going on here? I've tried so many things.