Home Forums WoodMart support forum All filter doesn't work for page display

All filter doesn't work for page display

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #27911

    jinsley8
    Participant

    Hi,

    The product filter (12 / 24 / All) doesn’t work for All.

    See here:
    https://woocommerce-99048-339054.cloudwaysapps.com/product-category/product-type/keychains-product-type/

    #27917

    Artem Temos
    Keymaster

    Hi,

    Could you please provide us your FTP access so we can check why this option doesn’t work for you?

    Thank you

    #29535

    jinsley8
    Participant

    Hi,

    Sorry, I didn’t see the response email for this.

    Login and FTP info attached. View All sorting doesn’t work.

    #29547

    Artem Temos
    Keymaster

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    function woodmart_shop_products_per_page() {
    	$per_page = 12;
    	$number = apply_filters('woodmart_shop_per_page', woodmart_get_products_per_page() );
    	if( $number == -1 ) $number = 99999;
    	if( is_numeric( $number )  &&  $number > 0) {
    		$per_page = $number;
    	}
    	return $per_page;
    }
    
    add_filter( 'loop_shop_per_page', 'woodmart_shop_products_per_page', 20 );

    Regards

    #29551

    jinsley8
    Participant

    Yes that works! Thank you

    #29580

    jinsley8
    Participant

    Actually, now the selected option stays after page refresh until you change it.

    If I click 24 or All on the sorting filter, remove the parameters from URL or go to another page then back it’s still sorted to the last option I checked. It doesn’t default back to 12.

    #29604

    Artem Temos
    Keymaster

    Yes, it is the way it works. It remembers user’s selected option so you don’t need to click it each time you visit the shop page.

Viewing 7 posts - 1 through 7 (of 7 total)