diff --git a/framework/spree/product/use-search.tsx b/framework/spree/product/use-search.tsx index 6eafc6a92..f9beac38c 100644 --- a/framework/spree/product/use-search.tsx +++ b/framework/spree/product/use-search.tsx @@ -31,14 +31,12 @@ export const handler: SWRHook = { const taxons = [input.categoryId, input.brandId].filter(Boolean) - const filter = - taxons.length > 0 - ? { - filter: { - taxons: taxons.join(','), - }, - } - : {} + const filter = { + filter: { + ...(taxons.length > 0 ? { taxons: taxons.join(',') } : {}), + ...(input.search ? { name: input.search } : {}), + }, + } const sort = input.sort ? { sort: nextToSpreeSortMap[input.sort] } : {}