Search result show out of stock items in last
-
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.
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