Home Forums WoodMart support forum Search result show out of stock items in last

Search result show out of stock items in last

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #320518

    chethan
    Participant

    Hi Team,

    Thank you for great support so far i have one query i don’t want to hide out-of-stock items i just want to show them in last in search pages how do i sort it? i already using one filter to sort shop page but dont know how to do it for search page.

    add_filter( 'woocommerce_get_catalog_ordering_args', 'vizsoft_first_sort_by_stock_amount', 9999 );
     
    function vizsoft_first_sort_by_stock_amount( $args ) {
       $args['orderby'] = 'meta_value';
       $args['meta_key'] = '_stock_status';
       return $args;
    }
    
    
    Attachments:
    You must be logged in to view attached files.
    #320546

    Artem Temos
    Keymaster

    Hi,

    Sorry, but there is no such option in our theme and WooCommerce by default. It may require additional code customization or extra plugin but we don’t have an instruction for this. It is out of our theme support scope.

    Regards

Tagged: ,

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