Skip to main content
Solved

Dynamic variant image in abandoned cart


Forum|alt.badge.img

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?

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

2 replies

stephen.trumble
Community Manager
Forum|alt.badge.img+60
  • Community Manager
  • 1518 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
  • 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!!