Search results infinite loading
-
Hi,
We’ve in our store infinite loading. We also want this in the search results.
Could you please tell us how we can do that?
Thanks a lot!
Kind regards,
Jasper
Hi,
Unfortunately, WooCommerce doesn’t allow us to make ajax loading on the search page. Technically, it is not possible.
Regards
Hi,
Thanks for your reaction!
Can we set amount of search results on 36 per page?
Like to hear from you soon!
Kind regards,
Jasper
Hi,
Try to add the following PHP code snippet to the child theme functions.php file to do this
function woodmart_shop_products_per_page() {
$per_page = 12;
$number = apply_filters('woodmart_shop_per_page', woodmart_get_products_per_page() );
if( is_numeric( $number ) ) {
$per_page = $number;
}
if ( is_search() ) {
$per_page = 36;
}
return $per_page;
}
add_filter( 'loop_shop_per_page', 'woodmart_shop_products_per_page', 20 );
Is this only in the search results? Because we’ve infinit loading in the shop.
Thanks!
Yes, it is for the search page only.