Exclude Green Shipping Protection from Klaviyo abandon cart campaigns

Green Shipping Protection can be excluded from displaying as line items on Klaviyo email and sms messages

When you setup abandon cart flows in Klaviyo, you probably don't want shipping protection to be displayed as the feature items in your messaging. You can easily remove shipping protection with some conditional logic in the email and sms templates


The abandon cart emails will list out all the line items in the cart before the customer abandoned. You can exclude shipping protection from that list with the following block of code.


Text Content

{% if item.product.handle != 'sustainability-coverage' %}...{% endif %}


Image Content

{% if item.product.handle != 'sustainability-coverage' %}{% if item.product.variant.images.0.src %}{{item.product.variant.images.0.src}}{%else%}{{item.product.images.0.src|missing_product_image}}{%endif%}{%endif%}


If you are displaying a media image in your sms, you will want to make sure it isn't the shipping protection image. This piece of code should the dynamic image content



{% if event.extra.line_items.0.product.handle == 'sustainability-coverage' %}{{ event.extra.line_items.1.product.images.0.src }}{% else %}{{ event.extra.line_items.0.product.images.0.src }}{% endif %}