• Hi is their a way to make the out of stock put it on the bottom.

    I found some code. However if i put this on my function the plugin will not work. Just want to ask is their a way. to put this code and at the same time your plugin will work.

    add_filter( ‘woocommerce_get_catalog_ordering_args’, ‘bbloomer_first_sort_by_stock_amount’, 9999 );

    function bbloomer_first_sort_by_stock_amount( $args ) {
    $args[‘orderby’] = ‘meta_value’;
    $args[‘order’] = ‘ASC’;
    $args[‘meta_key’] = ‘_stock_status’;
    return $args;
    }

Viewing 1 replies (of 1 total)
  • Plugin Author Aslam Doctor

    (@aslamdoctor)

    You are doing orderby=’meta_value’ so definitely it will not work. For this to work, the order should be ‘menu_order’ which is default sort order in woocommerce.

Viewing 1 replies (of 1 total)
  • The topic ‘Make the out of stock at the bottom automatic’ is closed to new replies.