• Resolved dominmax

    (@dominmax)


    Hello,
    My main problem is still unsolved.
    Hidden products are counted in Catalog and causes empty spaces.

    It is deeply described here:
    https://ar.neodirect.pl/kategoria-pracy/aatest/

    Because I’ve lost any hope, I am trying another solution that maybe could help.
    I would like to sort the hidden products to the end of a catalog list.
    But I have already sorted sold products to the end of the catalog list.

    I am using such a code:

    add_action( 'woocommerce_product_query', 'bbloomer_sort_by_stock_status_then_alpha', 999 );
    function bbloomer_sort_by_stock_status_then_alpha( $query ) {
        if ( is_admin() ) return;
        $query->set( 'meta_key', '_stock_status' );
        $query->set( 'orderby', array( 'meta_value' => 'ASC', 'date' => 'DESC' ) );
    } 

    So is it possible to rebuild the code and add also hidden products sorting DESC?

    Regards,
    Dominik

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to sort hidden products to the end’ is closed to new replies.