Solved

Klaviyo line items in dynamic table

  • 7 June 2021
  • 3 replies
  • 1117 views

Badge +2

Hi there,

I have a Shopify store and I need some assistance with dynamic line items in the Klaviyo abandoned cart email. 

Background
My products in Shopify have a 1 variant being size (standard licence) i.e X-Large, Large, Medium & Small.

I am using HulkApps Infinite options App to have customised options which include:
Extended Licence (Unlimited Print, Products for Resale, Unlimited Print + Products for Resale) &
Multi-Seat Licence (Up to 10, Up to 20, Up to 50)


Line item in Klaviyo

I have managed to get my product & Shopify variant working with the following code

{{ item.product.title }}
Standard License {{ event.extra.line_items.0.product.variant_options|lookup:'Standard Image License' }}
SKU: #{{ event.extra.line_items.0.sku }} 

 

This displays

 

The above displays in Klaviyo abandoned cart email when a customers selection is only a Shopify variant e.g Standard Licence - X-Large. Which is correct.

 

Line items of a product with product customisations

If a customer selects add ons to their product selection I need to reflect this back into line items.

Here is a screenshot of how my Shopify store displays this on an order confirmation page.
 

Here we can see that Shopify displays the first line item as the Variant option selected (X-Large). The second line item displays the added customizations for the first line item.

I need to create this setup in Klaviyo emails for the abandoned cart.
I have the following code in the data source to automatically add line items

Row Collection = event.extra.line_items

Alais = item

 

However, my question is how do I add in the customization line item for the line item 1?

 

I have found the following code in preview list:

{{ event.Items.1 }}

{{ event.extra.line_items.1.properties.0.name }}: {{ event.extra.line_items.1.properties.0.value }}

{{ event.extra.line_items.1.properties.1.name }}: {{ event.extra.line_items.1.properties.1.value }}

{{ event.extra.line_items.0.properties.0.name }} : {{ event.extra.line_items.0.properties.0.value }}

 

Which would display:

Customization Cost for Storm at Sea - X-Large 

Extended License: Unlimited Print [ $000.00 ]

Multi-Seat License: Multi-Seat: up to 10 seats [ $00.00 ]

Custom Product: 1210 

 

But how do I implement this? And how would the customization line item be hidden if the customer didn’t select this option?

 

I look forward to any help with this.

 

Kind regards,

 

Evan

 

 

icon

Best answer by Dov 8 June 2021, 18:07

View original

3 replies

Userlevel 7
Badge +61

Hi @Evan,

Thank you for sharing your question with the Klaviyo Community

The row collection and alias look good!

However, since you’re using event.extra.line_items as your row collection, you won’t be able to use the first tag {{ event.Items.1 }}  but the other tags will work if you keep the row collection and alias the same and use the following tags for item name and item value:

{{ item.properties.0.name }} : {{ item.properties.0.value }}
{{ item.properties.1.name }} : {{ item.properties.1.value }}

And in order to incorporate hide/show the block with the customization options, you would just need to include conditional statements in your tags. For example, ”item.properties.1.value == "up to 10 seats [ $10.00 ]" we have a help center article as a guide you can use here as well.

Additionally, I recommend double-checking the event data through the preview to see if the customization tags are showing up in the preview for users who did not select a customization option. If not, you’re all set without having to venture into hide/show.

Thanks and have a great day.

 

Badge

Hello! I’m also using Infinite Options and the abandoned cart email flow doesn’t seem to like that. Were you able to get the “Return to your cart” button to correctly populate the cart with the product with Infinite Options selections?

I’m not quite as adept at programming but able to learn enough to copy/paste stuff into the right spots. I’m a little confused by your dynamic table explanation above. Thanks for your time!

Userlevel 7
Badge +36

Hi @CTUG!

May I ask how you’re testing the abandoned cart flow? Are you using a cookied browser? Also, what is the exact issue - is the cart not repopulating with the correct items, or is the link not working at all?

 

This will help myself and other Community members understand the issue better.

 

Best,

Brian

Reply