Skip to main content
Solved

Dynamic Item product bloc is not working for my Shopify Abandonned card


Forum|alt.badge.img+3

I used he code below to create a block that calls back products from cart. Still it is not working ? 
What code exactly should we use for shopify > Klaviyo abandoned cart ?

{{ item.product.title }}

Quantity: {{ item.quantity|floatformat:0 }} — Total: {% currency_format item.line_price|floatformat:2 %}

Link : {{item.URL}}

Best answer by retention

@Annecharlotte - Your code looks correct, but just a few questions just to verify:

  • What is the Flow Triggered on?  Typically, this is for the event/metric called “Checkout Started” event.
  • Are you checking this within the Flow Message (Preview) or in the Email Template section?
  • Is the text above within a Text Block or a Table Block (Column Text)?
  • Did you properly integrate your Shopify Account with Klaviyo?

If the code you’re using lives within a “Table Block” make sure the “Data Source” has the proper row collection mapped to item as an alias since that is what you’re using as a variable like item.product.title and item.URL, etc.  See this example:


If you are using a plain Text Block (not within a Table Block), then you will want to set the alias here for repeating the Text Block.  See this example:

If neither of these work, another way to try is to download a pre-made “Abandoned Cart” example from the Klaviyo’s Library by clicking on “Browse Ideas” and then reformatting their example to match your email template.  

 

Additional Klaviyo Documentation to that might be helpful:

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

8 replies

retention
Partner - Platinum
Forum|alt.badge.img+62
  • 2025 Champion
  • 944 replies
  • Answer
  • March 17, 2021

@Annecharlotte - Your code looks correct, but just a few questions just to verify:

  • What is the Flow Triggered on?  Typically, this is for the event/metric called “Checkout Started” event.
  • Are you checking this within the Flow Message (Preview) or in the Email Template section?
  • Is the text above within a Text Block or a Table Block (Column Text)?
  • Did you properly integrate your Shopify Account with Klaviyo?

If the code you’re using lives within a “Table Block” make sure the “Data Source” has the proper row collection mapped to item as an alias since that is what you’re using as a variable like item.product.title and item.URL, etc.  See this example:


If you are using a plain Text Block (not within a Table Block), then you will want to set the alias here for repeating the Text Block.  See this example:

If neither of these work, another way to try is to download a pre-made “Abandoned Cart” example from the Klaviyo’s Library by clicking on “Browse Ideas” and then reformatting their example to match your email template.  

 

Additional Klaviyo Documentation to that might be helpful:


Forum|alt.badge.img+3
  • Author
  • Contributor IV
  • 7 replies
  • March 17, 2021
  • Yes the flow is based on “Checkout Started” event.
  • I am checking within the Flow Message (Preview) 
  • The text above within a Table Block (Column Text)?
  • Integration with Shopify works well (official plugin)
  • I used the official Abandonned card reminder but this “product bloc” is not included so I try to add it. 
  •  


retention
Partner - Platinum
Forum|alt.badge.img+62
  • 2025 Champion
  • 944 replies
  • March 17, 2021

@Annecharlotte - In that Table Block you added, click on the “Data Source” tab, can you share what you have there? See here:

 


Forum|alt.badge.img+3
  • Author
  • Contributor IV
  • 7 replies
  • March 17, 2021

Same as you 

 


Forum|alt.badge.img+3
  • Author
  • Contributor IV
  • 7 replies
  • March 26, 2021

@retention do you have the exact code to add this block to my Klaviyo template (for shopify) - I can’t find the data here ? 


David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • April 28, 2021

Hey @Annecharlotte,

Adding to @retention (Thank you!), can you share with us what you have added into the “Data Source” of your text block? It looks like you have only shared with us a screenshot of Column 1 of your table block as opposed to your Data Source section for the block. 

By default, the Data Source for this dynamic block should read: Row Collection = event.extra.line_items and Row Alias = item as depicted below. Keep in mind though that although those are the default Row Collection and Row Alias, the ones you need to use to align with your account may need to be adjusted.

Another solution would be along the same lines of what @retention had mentioned before of creating a Default Abandoned Cart flow from the Klaviyo flow library. Once created, you can also navigate and Save the pre-build Dynamic Table Block for use within your own customized flow if you like. Saving and using saved blocks can be found in the Create and Manage Saved Blocks guide. 

Reviewing further on the screenshots you shared, it leads me to believe that you may have the incorrect syntax for the Column 1 Image source. Since you are trying to have Column 1 dynamically display an image, the placeholder URL should be a .src type as opposed to a .url type like what you have in your screenshot. For example, instead of the syntax of {{ item.images.0.url }} you are using, it should be something like {{ item.product.variant.images.0.src }}.

Other helpful articles we offer that would assist you in learning more about dynamic blocks and building them can be found below:

Hope this helps!

-David


Forum|alt.badge.img+3
  • Author
  • Contributor IV
  • 7 replies
  • April 28, 2021
Hi, thanks for the help, here are the datas

 


Forum|alt.badge.img+3
  • Author
  • Contributor IV
  • 7 replies
  • April 28, 2021

Ok @david.to & @retention   finally found the solution through a Default Abandoned Cart flow from the Klaviyo flow library.

But you can’t see the data at first sight, you have to go deeper and to edit this template to atually see the block … 
Anyway, thanks. It’s solved ! (until my next issue… ) :)