ajax search result need to sort by InStock
-
hey
i need to sort ajax search result by In Stock First.
how should i do this
Hello,
Sorry, but there is no option in Theme Settings to sort the ajax search results.
It requires customizations and this is beyond our limitations and support policy.
Regards.
Xtemos Studios.
witch filter should i use to access ajax search suggests ?
Hello,
Sorry, I did not understand your question.
Best Regards.
I need to re Order Ajax search suggested result but I need to know witch Filter should i Use to access that results.
Hello,
You can find the file under “woodmart/inc/modules/search.php”
You can customize it at your own risk.
Regards.
Xtemos Studios.
I try to handle with this but it’s not work would you please correct me?
add_filter(‘woodmart_ajax_search_args’, ‘custom_ajax_result_orderby_stock’,20);
function custom_ajax_result_orderby_stock($query_args) {
$query_args[‘orderby’] = ‘_stock_status’;
$query_args[‘order’] = ‘ASC’;
return $query_args;
}
Hello,
Please try these parameters:
$args['orderby'] = 'meta_value';
$args['order'] = 'ASC';
$args['meta_key'] = '_stock_status';
Best Regard
Nice done, that’s work great
I suggest you to add this option to the next version of Woodmart.
The topic ‘ajax search result need to sort by InStock’ is closed to new replies.