Skip to main content
Solved

Dynamic variant image in abandoned cart

  • 4 June 2024
  • 2 replies
  • 52 views

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!

2 replies

Userlevel 7
Badge +60
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?

Badge

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

Reply