Woocommerce sort by meta_key stock with menu_order
-
I have created custom sorting option by stock date (which means when I change the status outstock to instock) it will give the product list by modified date. I got the list by using this code:
$args[‘orderby’] = array(
‘meta_value_num’ => ‘DESC’,
‘title’ => ‘ASC’,
);
$args[‘meta_key’] = ‘_stock’;
I would like to sort by stock update with menu_order, so I tried this:$args[‘orderby’] = array(
‘meta_value_num’ => ‘DESC’,
‘title’ => ‘ASC’,
‘menu_order’ => ‘ASC’,
);
$args[‘meta_key’] = ‘_stock’;
But it doesn’t list properly.Can anyone help me, please? It would be appreciated.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Woocommerce sort by meta_key stock with menu_order’ is closed to new replies.