Solved

Exclude products in the review email flow

  • 20 March 2023
  • 2 replies
  • 122 views

Badge +1
  • Contributor I
  • 1 reply

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 %}

 

icon

Best answer by retention 21 March 2023, 00:29

View original

2 replies

Userlevel 7
Badge +57

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!

Badge +1

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, 

Reply