• Hi There,

    I tried the code to order 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;
    }

    It is not working. Please check how to fix.

    Thankyou!

    Adrider

Viewing 1 replies (of 1 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Did you clear plugin cache by clicking ‘Clear cache’ button from the plugin settings page after adding this code?

Viewing 1 replies (of 1 total)

The topic ‘Order by sku’ is closed to new replies.