Skip to main content
Solved

Dynamic variant image in abandoned cart

  • June 4, 2024
  • 5 replies
  • 277 views

Forum|alt.badge.img+1

Hello,

I am trying insert the dynamic image (variant) for my products in abandoned cart but when trying to see the preview,  the images of my products do not show up.  I have tried this code for the dynamic image:

{% if item.product.variant.images.0.src %}{{item.product.variant.images.0.src}}{%else%}{{item.product.images.0.src|missing_product_image}}{%endif%}

All my products with images are published in my Klaviyo account so it should be working, unless I’ve missed something.

 

Would you guys be able to help me by any chance?

Thanks!

Best answer by stephen.trumble

Hey @Valentin Welcome to the community! It looks like you are using the correct syntax for the variant image to be shown. {% if item.product.variant.images.0.src %}{{item.product.variant.images.0.src}}{%else%}{{item.product.images.0.src|missing_product_image}}{%endif%}

Have you tried sending a test email instead of previewing it? Does the test email still not show the variant?

5 replies

stephen.trumble
Forum|alt.badge.img+60
  • Klaviyo Alum
  • 1515 replies
  • Answer
  • June 6, 2024
Hey @Valentin Welcome to the community! It looks like you are using the correct syntax for the variant image to be shown. {% if item.product.variant.images.0.src %}{{item.product.variant.images.0.src}}{%else%}{{item.product.images.0.src|missing_product_image}}{%endif%}

Have you tried sending a test email instead of previewing it? Does the test email still not show the variant?


Forum|alt.badge.img+1
  • Author
  • Contributor I
  • 1 reply
  • June 10, 2024

Hey Stephen,  Thank you for getting back to me. It finally worked and I can now see the photos of my product! Thanks!!


  • Contributor I
  • 2 replies
  • July 17, 2025

Hiya! I am having the same issue, though I’ve used the code listed above and I’m still not having the images load (see attached image). Is this more of an issue with our the connection between Klaviyo and Shopify vs. an issue with my Dynamic Image code? 

This is from an automated flow email, specifically an ‘Abandoned Cart’ email flow.

Appreciate any help on this! 

 


Byrne C
Community Manager
Forum|alt.badge.img+27
  • Community Manager
  • 562 replies
  • July 17, 2025

Hey ​@Brooke_Gillard,

That does appear to be an issue with your connection with Shopify! When you visit your product catalog https://www.klaviyo.com/catalog/items and search one of these two items, are they displaying the correct images, or are the images also blank in your catalog? If they are blank, you might have to resync the catalog items by pressing “Resync item” on either a product page, or a page of your catalog. If that still isn’t working, I’d recommend reaching out to our support team at klaviyo.com/support, who can take a look at your integration to double check to ensure that catalog data and events are syncing over correctly!


  • Contributor I
  • 2 replies
  • July 22, 2025

Hi Byrne, 

Thanks so much for your reply! I managed to get a customer service agent to help out with our back end. If anyone is reading this with the same issue, my core problem was that the product selection hadn’t been updated/resynced in a while, so any new products were not showing up correctly. 

Thanks for the help!!