Skip to main content
Solved

How to add the variant image as dynamic image in a abandoned cart flow?

  • April 9, 2024
  • 3 replies
  • 544 views

Forum|alt.badge.img+2

Hello,

I use Shopify and I am trying to create the Abandoned Cart flow, however when I add the dynamic image variable, it’s pulling the product’s first image, and not the variant image that is actually added to the cart. Does anyone know if its possible to populate the variant’s image so I do not confuse the recipient? I am using the variable available in the Help Site and from the event trigger info: 

{{ event.extra.line_items.0.product.images.0.src }}

Best answer by retention

Hi @bunnyb, welcome to the community!

You should be able to use the variant images (if there is one), try this in your image block image source value: 

{{ event.extra.line_items.0.product.variant.images.0.src }}

Note, this shows the first line item’s first variant image from a “Started Checkout” Shopify event.

 

If you are showing this in a looped Table Block, where your Row Collection is repeating over every: event.extra.line_items with an alias of item, the code will look like this in the Dynamic image field:

 

{{item.product.variant.images.0.src}}

 

Like this:

 

See if that works for you!

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

3 replies

retention
Partner - Platinum
Forum|alt.badge.img+62
  • 2025 Champion
  • 944 replies
  • Answer
  • April 9, 2024

Hi @bunnyb, welcome to the community!

You should be able to use the variant images (if there is one), try this in your image block image source value: 

{{ event.extra.line_items.0.product.variant.images.0.src }}

Note, this shows the first line item’s first variant image from a “Started Checkout” Shopify event.

 

If you are showing this in a looped Table Block, where your Row Collection is repeating over every: event.extra.line_items with an alias of item, the code will look like this in the Dynamic image field:

 

{{item.product.variant.images.0.src}}

 

Like this:

 

See if that works for you!


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 2 replies
  • April 9, 2024

Hello @retention,

That worked like a charm.  Thanks so much.

I think it would be beneficial to other users that may have the same question as me and use the Klaviyo Knowledge Base as reference, if this information was added to Step 6: add an image and to the Shopify table in this article.

 

Thanks again!


  • Contributor I
  • 1 reply
  • April 16, 2024

Hi there, I’m looking for the same solution. 

 

I have tried inserting this solution into the dynamic image source within the Klaviyo pre-built template and nothing seems to work.

This is the exported code that creates broken images: