Solved

Dynamic product image variable

  • 28 February 2023
  • 5 replies
  • 806 views

Badge +1
  • 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?

icon

Best answer by stephen.trumble 1 March 2023, 11:55

View original

5 replies

Userlevel 7
Badge +60

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!

Badge +1

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

Badge +1

Can anyone help??

Userlevel 5
Badge +12

Hi @cem,

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

 

Badge +1

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?

Reply