Skip to main content
Contributor I
March 20, 2023
Solved

Exclude products in the review email flow

  • March 20, 2023
  • 2 replies
  • 183 views

We have a product “Signature On Delivery” that is not a product in our Bigcommerce catalog. It gets added during checkout via the API. Is there a way to exclude products in the review email flow with specific name? eg. 

Something like this:

{% if not 'Signature on Delivery' in item.product.name %}
<div style="text-align:left;"><h3>{{ item.product.name }}</h3>
<p><a href="{{ organization.url|trim_slash }}{{ item.product.url }}#product-reviews">Review this item</a></p></div>
{% endif %}

 

This topic has been closed for replies.
Best answer by retention

Hi @nhd, welcome to the community!

I think your condition should work so long as your data variables correctly returns a String value and matches perfectly (spaces included).  You may want to use something that might be more precise like a SKU or Product ID instead.

Also, make sure the event data is properly assigned to the alias “item” in your Table.  I’m not super familiar with the event data coming from BigCommerce, but verify that by testing your example.

Here’s a response I wrote for something similar that you can borrow the code snippets from a similar use case:

Let us know how it works out!

2 replies

retention
Partner - Platinum
retentionAnswer
2025 Champion
March 20, 2023

Hi @nhd, welcome to the community!

I think your condition should work so long as your data variables correctly returns a String value and matches perfectly (spaces included).  You may want to use something that might be more precise like a SKU or Product ID instead.

Also, make sure the event data is properly assigned to the alias “item” in your Table.  I’m not super familiar with the event data coming from BigCommerce, but verify that by testing your example.

Here’s a response I wrote for something similar that you can borrow the code snippets from a similar use case:

Let us know how it works out!

Joseph Hsieh // retentioncommerce.com // X: @retention
nhdAuthor
Contributor I
March 21, 2023

Thanks for your suggestion @retention. It actually works perfectly. I just did not save my changes thats why it was not working. I did not do the image because that “product” does not have an image but it may be achieved by converting the image block to normal text and apply the same logic above. 

{% if not 'Signature on Delivery' in item.product.name %}
<img src="{{ item.product.images.0.src }}" /> 
{% endif %}

Thank you,