Solved

Exclude products from abandoned cart emails

  • 13 February 2021
  • 3 replies
  • 267 views

Badge

Hello!

I am wondering if it is possible to exclude certain items from the dynamic table block for the abandoned cart e-mails. Or only include certain items/ collections. These are items that are “in” their cart but I do not want to send them to encourage them to finish checking out. For example I have the cloverly app for offsetting carbon footprint for shipping and I also have an app that I use to have multiple options for products. I don’t want these items showing in the abandoned cart e-mail. Is there a way to go about excluding these?

Thanks so much for any help!

Natalie

 

 

 

icon

Best answer by retention 15 February 2021, 17:42

@tangleartistry There is a way, but it requires some coding. It’s actually quite interesting to achieve.

If you have multiple different products that you want to exclude from the dynamic table block, the easiest way to do it is to tag those products in Shopify, and then use that tag to exclude the products.

Let’s say for example you tag them with “ac_exclude”.

Then, in the dynamic table block, you need to wrap the text part (Title, Quantity, Price, etc.) in an “IF” statement that should look like this:

{% if not 'ac_exclude' in item.product.tags %}
<h3><a href="{{ organization.url }}products/{{ item.product.handle }}">{{ item.product.title }}</a></h3>

<p>Quantity: {{ item.quantity|floatformat:0 }} — Total: {% currency_format item.line_price|striptags|floatformat:2 %}</p>
{% endif %}

This will check for each product if “ac_exclude” is one of the tags. If the product doesn’t have the “ac_exclude” tag, it will be shown in the feed.

For the image part, you need to wrap the existing snippet, in a new “IF” statement that should look like this:

{% if not 'ac_exclude' in item.product.tags %}{% if item.product.variant.images.0.src %}{{item.product.variant.images.0.src}}{%else%}{{item.product.images.0.src|missing_product_image}}{%endif%}{%endif%}

 

Hope that you’ll succeed in implementing this!

View original

3 replies

Userlevel 6
Badge +5

@tangleartistry There is a way, but it requires some coding. It’s actually quite interesting to achieve.

If you have multiple different products that you want to exclude from the dynamic table block, the easiest way to do it is to tag those products in Shopify, and then use that tag to exclude the products.

Let’s say for example you tag them with “ac_exclude”.

Then, in the dynamic table block, you need to wrap the text part (Title, Quantity, Price, etc.) in an “IF” statement that should look like this:

{% if not 'ac_exclude' in item.product.tags %}
<h3><a href="{{ organization.url }}products/{{ item.product.handle }}">{{ item.product.title }}</a></h3>

<p>Quantity: {{ item.quantity|floatformat:0 }} — Total: {% currency_format item.line_price|striptags|floatformat:2 %}</p>
{% endif %}

This will check for each product if “ac_exclude” is one of the tags. If the product doesn’t have the “ac_exclude” tag, it will be shown in the feed.

For the image part, you need to wrap the existing snippet, in a new “IF” statement that should look like this:

{% if not 'ac_exclude' in item.product.tags %}{% if item.product.variant.images.0.src %}{{item.product.variant.images.0.src}}{%else%}{{item.product.images.0.src|missing_product_image}}{%endif%}{%endif%}

 

Hope that you’ll succeed in implementing this!

Badge

@retention Thank you so much! This worked perfectly. I couldn’t figure it out at first and thought it wasn’t working. Then realized it was because I added the tags to the products, and the preview carts I was using to test were done before the tags were added. Thank you tremendously for taking the time to do this for me :hugging:

 
Userlevel 6
Badge +5

@retention Thank you so much! This worked perfectly. I couldn’t figure it out at first and thought it wasn’t working. Then realized it was because I added the tags to the products, and the preview carts I was using to test were done before the tags were added. Thank you tremendously for taking the time to do this for me :hugging:

 

 

Really glad that you’ve figured out how to implement it. It can be tricky.

Reply