Skip to main content
Contributor I
February 28, 2023
Solved

Dynamic product image variable

  • February 28, 2023
  • 5 replies
  • 1363 views

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?

    This topic has been closed for replies.
    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!

    5 replies

    stephen.trumble
    Klaviyo Alum
    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!

    -Stephen
    cemAuthor
    Contributor I
    March 2, 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!

    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

    cemAuthor
    Contributor I
    March 6, 2023

    Can anyone help??

    Jakub
    Partner - Silver
    Partner - Silver
    March 6, 2023

    Hi @cem,

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

     

    -=JB=-
    cemAuthor
    Contributor I
    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?