I’d like to know if there is a way to exclude a product from the dynamic listing on the abandoned cart/checkout emails by using product tags?
To give you more context I use an app to add a one time service fee per order, it gets automatically added to the customers cart as a product as there is no other way to add a custom fee in shopify.
If the customer abandons the cart/checkout, I want to be able to exclude this fee product from listing on the abandoned cart/checkout emails and only to show the actual products they were trying to purchase.
@Mussty you can exclude a specific product from the abandoned cart/checkout emails by using product tags in Shopify. Here’s how you can do it:
Go to your Shopify admin and select the product that you want to exclude from the abandoned cart/checkout emails.
Scroll down to the Tags section and add a new tag, such as “exclude_from_abandoned_emails” (you can choose any tag name you prefer).
Save the changes to the product.
Now that you have added the product tag, you can create a custom abandoned cart/checkout email template that excludes any products with that tag. Here’s how you can do it:
Go to your Shopify admin and navigate to Settings > Notifications.
Find the abandoned cart/checkout email template that you want to customize and click Edit.
Scroll down to the email template code and look for the section that displays the abandoned products.
Modify the code to exclude any products with the “exclude_from_abandoned_emails” tag. You can do this by adding a conditional statement that checks if the product has the tag, and if so, skips it in the product listing. For example, here’s a sample code snippet that you can use:
{% for line in line_items %}
{% if line.product.tags contains 'exclude_from_abandoned_emails' %}
{% continue %}
{% endif %}
{{ line.product.title }}
{{ line.price | money }}
{% endfor %}
Save the changes to the email template.
With these changes, the abandoned cart/checkout emails will exclude any products that have the “exclude_from_abandoned_emails” tag, including the service fee product that you mentioned.
Go to your Shopify admin and navigate to Products > Collections.
Click the Create collection button to create a new collection.
Give the collection a name, such as “Abandoned Cart Exclusions”.
In the Conditions section, set the conditions so that the collection only includes the products you want to exclude from the abandoned cart/checkout emails. In your case, you would set the condition to “Product tag is not equal to exclude_from_abandoned_emails”.
I have already hidden the service fee product from my All collection, I have also hidden this from search engines and internal search by adding the metafield feature seo.hidden set to true. I’m not entirely sure how this is linked to hiding it from abandoned emails?
It seems none of the Shopify Email App templates are editable with code. This is so lame on Shopify’s part.