diff --git a/packages/api/src/platforms/vtex/utils/skuVariants.ts b/packages/api/src/platforms/vtex/utils/skuVariants.ts index ae1d631bcb..079811d2d4 100644 --- a/packages/api/src/platforms/vtex/utils/skuVariants.ts +++ b/packages/api/src/platforms/vtex/utils/skuVariants.ts @@ -158,8 +158,6 @@ export function getFormattedVariations( return } - const variantImageToUse = findSkuVariantImage(variant.images) - const dominantVariantEntry = variant.variations.find( (variation) => variation.name === dominantVariantName ) @@ -179,6 +177,8 @@ export function getFormattedVariations( previouslySeenPropertyValues.add(nameValueIdentifier) + const variantImageToUse = findSkuVariantImage(variant.images, dominantVariantName) + const formattedVariant = { src: variantImageToUse.imageUrl, alt: variantImageToUse.imageLabel ?? '', @@ -204,6 +204,8 @@ export function getFormattedVariations( previouslySeenPropertyValues.add(nameValueIdentifier) + const variantImageToUse = findSkuVariantImage(variant.images, variationProperty.name) + const formattedVariant = { src: variantImageToUse.imageUrl, alt: variantImageToUse.imageText ?? '',