SKU – sort – ralavance
-
Hi There,
For out customer we use the sort on sku:
add_filter( ‘aws_search_results_products’, ‘aws_search_results_products’ );
function aws_search_results_products( $products ) {
usort($products, function ($item1, $item2) {
$a = $item1[‘sku’];
$b = $item2[‘sku’];
if ($a == $b) {
return 0;
}
return ($a < $b) ? -1 : 1;
});
return $products;
}++
Works good. Only our customer asks us if it possible:
Relavance on title, this products needs to show first. (sorting on the sku needs to be disabled)
When the searchterm is found in the description, can the search results be sorted on sku.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘SKU – sort – ralavance’ is closed to new replies.