Skip to main content
Solved

Dynamic product image variable

  • February 28, 2023
  • 5 replies
  • 1127 views

Forum|alt.badge.img+2
  • Contributor I
  • 3 replies

Hi everyone,

 

We’re looking to display the dynamic product variant image of the ordered product in our emails, so let’s say customer A orders a pair of jeans in the color white and the products first variant image is jeans blue, then the variable we’re using will only display the image of the first variant.

 

Which variable would be the right one to display the ordered line items correct image?

 

Right now, we’re using {{ event.extra.line_items.0.product.images.0.src }}. How can we replace the 0 in such way, that the variable leads to the ordered item’s image?

Best answer by stephen.trumble

Hey @cem 

Welcome to the Klaviyo Community, happy to have you join us! 

You should be able to use the variant image of the tag,  item.product.variant.images.0.src​By changing the current tag with this one, you will display the variant image of the Product your customer has purchased.

?name=inline-232396582.png

Hope this helps!

View original
Did this topic or the replies in the thread help you find an answer to your question?

5 replies

stephen.trumble
Community Manager
Forum|alt.badge.img+60
  • Community Manager
  • 1518 replies
  • Answer
  • March 1, 2023

Hey @cem 

Welcome to the Klaviyo Community, happy to have you join us! 

You should be able to use the variant image of the tag,  item.product.variant.images.0.src​By changing the current tag with this one, you will display the variant image of the Product your customer has purchased.

?name=inline-232396582.png

Hope this helps!


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • March 2, 2023
stephen.trumble wrote:

Hey @cem 

Welcome to the Klaviyo Community, happy to have you join us! 

You should be able to use the variant image of the tag,  item.product.variant.images.0.src​By changing the current tag with this one, you will display the variant image of the Product your customer has purchased.

?name=inline-232396582.png

Hope this helps!

Unfortunately, it still only shows the first image of a particular product instead of the variant’s image. So, the wrong color is displayed in my images.

 

Any idea? BR


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • March 6, 2023

Can anyone help??


Jakub
Partner - Silver
Forum|alt.badge.img+13
  • Partner - Silver
  • 125 replies
  • March 6, 2023

Hi @cem,

I search did anyone else had similar problem and I found this solution recommended by @Dov 

 


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • March 7, 2023

Thanks for your help. Also came across this thread, but unfortunately this solution did not help.

 

Klaviyo is still showing the first variant’s image, instead of the customer’s selection.

 

Any other ideas?