From 917db3ef0364326d3548caf3a1215f10019d0c12 Mon Sep 17 00:00:00 2001 From: guitavano Date: Wed, 2 Oct 2024 09:23:07 -0300 Subject: [PATCH] improve return of product on dynamic options --- vtex/loaders/options/productIdByTerm.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vtex/loaders/options/productIdByTerm.ts b/vtex/loaders/options/productIdByTerm.ts index 5da5a1d85..d1decf347 100644 --- a/vtex/loaders/options/productIdByTerm.ts +++ b/vtex/loaders/options/productIdByTerm.ts @@ -18,9 +18,11 @@ const loader = async (props: Props, req: Request, ctx: AppContext) => { label: "No products found, use search", }]; } + return suggestions?.products?.map((product) => ({ value: `${product.productID}`, - label: `${product.productID} - ${product.name}`, + label: + `${product.productID} - ${product.isVariantOf?.name} ${product.name} - ${product.isVariantOf?.productGroupID}`, image: product.image?.[0]?.url, })); };