Skip to main content
Question

Hiding Dynamic products from cart

  • May 22, 2026
  • 3 replies
  • 17 views

Forum|alt.badge.img

Hi Everyone,

we are on shopify and klaviyo and are running into an issue and trying to find out how to fix it. We have an auto add to cart for a 10 year warranty on shopify site, when our clients abandon the cart or checkout they get an email with the 10 year warranty in there. Is there a way to exclude products from displaying in dynamic blocks in klaviyo? we just want to show the product and not the warranty that they left in the cart. Please let me know if anyone has any ideas on how to do this.

3 replies

Nick
Problem Solver II
Forum|alt.badge.img+4
  • Problem Solver II
  • May 22, 2026

Hi Ryan, 

you could use the following code for that:

<style>

@media (min-width: 768px) {
.container {
display: flex;
justify-content: space-between;
}
.column {
flex: 0 0 48%;
}
}


@media (max-width: 767px) {
.container {
text-align: center;
}
}
</style>
<div class="container">
<div class="column" style="text-align: center;">{% if not 'XY' in item.product.title and not 'YZ' in item.product.title %}
<div style="text-align: center;">{% if item.product.variant.images.0.src %} <img style="width: 200px; display: block; margin-left: auto; margin-right: auto;" src="{{ item.product.variant.images.0.src }}" width="200"> {% else %} <a href="{{ organization.url|trim_slash }}/products/{{ item.product.handle }}" style="color: #000000; font-weight: 400;"><img style="width: 200px; display: block; margin-left: auto; margin-right: auto;" src="{{ item.product.images.0.src|missing_product_image }}" width="200"></a> {% endif %}</div>
{% endif %}</div>
<div class="column" style="text-align: center;">{% if not 'XY' in item.product.title and not 'YZ' in item.product.title %}
<h3 style="text-align: center; margin-top: 10px;"><span style="color: rgb(0, 0, 0); font-weight: 400; font-size: 18px; font-style: normal;"> <a href="{{ organization.url|trim_slash }}/products/{{ item.product.handle }}" style="color: rgb(0, 0, 0); font-weight: 400; font-style: normal;">{{ item.product.title }}</a> </span></h3>
<p>Quantity: {{ item.quantity|floatformat:0 }}<br>Price: {% currency_format item.price|floatformat:2 %} {% if item.compare_at_price %}<span style="text-decoration: line-through; font-size: 12px;">{% currency_format item.compare_at_price|floatformat:2 %}</span> {% endif %}</p>
{% endif %}</div>
</div>

The way it works: 

  1. You still using the dynamic table but instead of two columns you only have one text column where you put the code from above. 
  2. For XY or YZ you put the product title of the product you want to hide in the dynamic table (has to match the title in the event - case sensitive. 
  3. You have to replace that twice (once to hide the image from the table and then once for the title and quantity on the right side of the table). 
  4. The html is also mobile optimized and will show two columns on desktop and only one on mobile. 

brightirismarketing
Problem Solver II
Forum|alt.badge.img+2

Hi ​Ryan! 

Love Nick’s code solution above. If you wanted to still use the dynamic block, in the Added to Cart flow specifically (the one that only pulls in one product, not the entire cart), my recommendation would be to add an exclusion on the flow trigger to not send for the specific warranty product. 


Claudia Howard
Contributor II
Forum|alt.badge.img+4

Here’s the solution I use with my clients…