Make the out of stock at the bottom automatic
-
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)
Viewing 1 replies (of 1 total)
- The topic ‘Make the out of stock at the bottom automatic’ is closed to new replies.