From 57c176d9d7a32678760fe42677fa1d3f79a92152 Mon Sep 17 00:00:00 2001 From: tniezg Date: Tue, 24 Aug 2021 15:10:10 +0200 Subject: [PATCH] Sort products by available_on when using the Trending sorting in useSearch --- framework/spree/product/use-search.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/spree/product/use-search.tsx b/framework/spree/product/use-search.tsx index 2945592be..7411d7363 100644 --- a/framework/spree/product/use-search.tsx +++ b/framework/spree/product/use-search.tsx @@ -7,7 +7,7 @@ import type { GraphQLFetcherResult } from '@commerce/api' import { IProducts } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' const nextToSpreeSortMap: { [key: string]: string } = { - 'trending-desc': 'updated_at', // FIXME: Spree has no "trending" filter. Using updated_at. + 'trending-desc': 'available_on', 'latest-desc': 'updated_at', 'price-asc': 'price', 'price-desc': '-price',