Skip to content

Commit

Permalink
improve return of product on dynamic options
Browse files Browse the repository at this point in the history
  • Loading branch information
guitavano committed Oct 2, 2024
1 parent 17cfac6 commit 917db3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vtex/loaders/options/productIdByTerm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}));
};
Expand Down

0 comments on commit 917db3e

Please sign in to comment.