Customize Checkout for Specific Product Tags - Debut Theme

Viewed 99

I am using the Debut theme. I have two types of products, one with the tag 'On sale' and others with the tag 'Normal'.

I want that if the customers add products with the tag 'On sale' the checkout is disabled. If they add products with the tag 'Normal', or products with both tags, the checkout should proceed as normal.

The following code helps to eliminate checkout for 'On sale' items,

{% if product.tags contains 'Normal' %}
  <Checkout>
{% else %}
  Not Available
{% endif %}

I tried to use operators (and, or) for including a scenario where checkout is possible with both tags but it isn't working.

{% if product.tags contains 'Normal' or 'On sale' %}
  <Checkout>
{% else %}
  Not Available
{% endif %}

The above won't stop checkout if there's only 'On sale' tag.

{% if product.tags contains 'Normal' and 'On sale' %}
  <Checkout>
{% else %}
  Not Available
{% endif %} 

The above won't work because the tags are specific to one product and not both.

Any help will be appreciated.

Thanks.

0 Answers
Related