Solved

Can I edit the abandoned cart product table to only show certain items?

  • 19 January 2023
  • 12 replies
  • 1153 views

Badge +1

Hello! First time posting. 

 

In the Abandoned Cart workflow, the dynamic table that is placed in the email shows a list of items that the customer added to their cart. However, I have some items I don’t want showing in the cart. For example, I dont want “shipping protection” shown which is technically a product line item in their cart, but it’s not the product. It’s just ugly and not necessary to show and I’m hoping to remove it from future emails.

It looks like the solution before was to wrap the table in an IF statement that excluded items I can tag. But I dont know how to do this in the new email builder. The prior solution is demonstrated in the old way.

Here’s the link to the answer using the old builder: 

 

How can I fix this?  

 

Thank you!
Steve

icon

Best answer by retention 20 January 2023, 00:30

View original

12 replies

Userlevel 7
Badge +58

Hi @RDLE, welcome to the community!

I think the link you referenced was one of my posts to this - so I’d thought I jump in here and see if I could help. In the new editor, you can do the same if/else code wherever a standard Text/HTML or Image source is required. 

See here: 

The tag `ac_exclude` is added to certain products in Shopify, so they will be skipped in the loop of items in the new cart. 

Badge +1

I really appreciate your help! It appears to be working on recent emails! 

Badge

Yes, you can edit the abandoned cart product table to only show certain items on Klaviyo. You can do this by using Klaviyo's liquid tags to filter the data and display only the desired items. For example, you can use the where filter to select specific products based on their attributes, such as product type or price range. You can also use the sort filter to sort the products in a specific order, such as by price or popularity. The exact method for filtering the abandoned cart product table will depend on the specific data you want to display and your familiarity with Klaviyo's liquid tags. If you need assistance, you may want to consider reaching out to Klaviyo's support team for guidance.

@retention Hey, I just came across your answer and find it very helpful. Just wondering if the same solution applies to Magento 2 instead of Shopify???

Userlevel 7
Badge +58

Hey @sarah3000, glad to see the community is helpful for you.  

From the Magento 2 Metrics (data) that Klaviyo syncs for the “Started Checkout” event, you may have to use another field like item.Product.Categories. Depending if your Magento setup can hide internal Categories from the customer facing website, you should be able to create a Category for internal use like (“ac_hide”) and then add items you choose into that category. Alternatively, I think you can also use custom product attributes if you have one to organize your products - but you need to make sure those fields and values are properly passed to Klaviyo for it to work.  

From there, the If/Else works the same, except the variable name will be different of course.  If you’re using Product Categories, where the category is labeled as “ac_hide”, it might look like this:

// Looping over Items alias as item

{% if not “ac_hide” in item.Product.Categories %}

// Product Info 

{% endif %}
 

If you screenshot your template code and a raw metric data of a “Started Checkout” event, I can help a bit more.  See if the above works for you and let us know!

 

---

Joseph Hsieh // retentioncommerce.com // twitter: @retenion 

 

@retention Thank you very much! I’ve tried your solution, but it seems not to work atm.

Please find attached the template code and raw metric data. I’ve blurred out sensitive data, but I think you will still be able to see the important info:

 

 

 

Looking forward to your response.

 

Best

Sarah

Badge +2

Thanks for your help here

Userlevel 7
Badge +58

@sarah3000 - I think you have some syntax issues - you have to make sure you’re in the “source code” mode and make not mix HTML or text tags in the wrong places. 

For example, the code has to look like this:

{% if not “ac_hide” in item.Product.Categories %}
Product Tags go here

{% endif %}

And not:

{</a>% if not “ac_hide” in item.Product.Categories % <a href=”….”>}</a>


You can’t mix the HTML tags (like “</a>”) between the bracket/percent or percent/bracket {% or %}.  The code is very specific and those will break the syntax.  If this doesn’t make any sense, you may want to get some help from a developer or someone that can help you with the liquid code and HTML. 

Or, paste your raw code (not screenshot) and maybe I can give it another try?

@retention thank you very much. I actually don’t know how this happened.. But here’s the code from the standard ACF:

<div style="text-align: left;">
<h3><a href="{{ item.Product.FullURL }}">{{ item.Name }}</a></h3>
<p style="line-height: 20.8px;">Quantity: {{ item.Qty|floatformat:0 }} &mdash; Total: ${{ item.Price|floatformat:2 }}</p>
</div>

Where would I place the {% if not “ac_hide” in item.Product.Categories %} and {% endif %} ?

Thank you very much for the help

Userlevel 7
Badge +60

Hey @sarah3000,

Similar to @retention’s prior screenshot, you’ll want to put the code snippet within your dynamic table block as HTML via the source code button, indicated by this symbol: </>.

If you’re still having trouble, I would suggest reaching out to a developer or email designer you’re familiar with for more hands-on assistance. Klaviyo also has a vast network of Klaviyo Partners through our Partner Directory you can reach out for help!

David

Badge +2

Hi I’m trying to do a similar thing: I want to hide certain products from a for a post-purchase review request email (integration with Judge.me).  

I followed the example from the original reply, but it’s not working - I still see the item (Easyship shipping protection) in the table.

For the text, this is the custom line of code I used:

{% if not 'Easyship Shipping Protection' in event|lookup:'event.products.0.product_title' %}

{{ product|lookup:'product_title' }}<br /></span> <span ><a href="{{ product|lookup:'review_rating_url' }}">Review Now</a></span></div>

{% endif %}

 

For the image, I used this code:

{% if not 'Easyship Shipping Protection' in event|lookup:'event.products.0.product_title' %}

{% if product|lookup:'product_image_url' %}

{{ product|lookup:'product_image_url' }}

{% endif %}{% endif %}

 

The result still shows the product (Easyship Shipping Protection) that I tried to hide.

 

Does anybody know what I should be doing instead?

Thanks!
Yvonne

Badge +2

Hi,

I’d like to exclude certain products from a for a post-purchase review request email (integrated with Judge.me, so this is a manual review request using a table).  

I followed the example from the topic: "Can I edit the abandoned cart product table to only show certain items?", but it’s not working - I still see the unwanted item (Easyship shipping protection) in the table.

For the text input, this is the custom line of code I used:

{% if not 'Easyship Shipping Protection' in event|lookup:'event.products.0.product_title' %}

{{ product|lookup:'product_title' }}<br /></span> <span ><a href="{{ product|lookup:'review_rating_url' }}">Review Now</a></span></div>

{% endif %}

 

For the image input, I used this code:

{% if not 'Easyship Shipping Protection' in event|lookup:'event.products.0.product_title' %}

{% if product|lookup:'product_image_url' %}

{{ product|lookup:'product_image_url' }}

{% endif %}{% endif %}

 

The result still shows the product (Easyship Shipping Protection) that I tried to hide.

 

Does anybody know what I should be doing instead?

Thanks!

Reply