I'm trying to remove the 'Add to Cart' button for certain product categories. Is there a way to run script on the product page to possibly take the category breadcrumb and use that to determine if the 'Add to Cart' Button is visible?
Here is the code within the Lightspeed commerce:
<form action="{{ ('cart/add/' ~ product.vid) | url }}" id="product_configure_form" method="post">
{% if product.options or product.variants or product.custom %}
<div class="product-option row">
<div class="col-md-12">
{{ product | html_product_configure | raw }}
</div>
</div>
{% else %}
<input type="hidden" name="bundle_id" id="product_configure_bundle_id" value="">
{% endif %}
<div class="product-price row">
<div class="price-wrap col-xs-5 col-md-5">
{% if product.price.price_old %}
<span class="old-price">{{ product.price.price_old | money }}{% if shop.settings.legal.mode == 'strict' %} {{ 'SRP' | t }}{% endif %}</span>
{% endif %}
<span class="price">{{ product.price.price | money }}{% if shop.settings.legal.mode == 'strict' %} <small>*</small>{% endif %}</span>
{% if shop.b2b %}<small class="price-tax">{{ 'Excl. VAT' | t }}</small>{% else %}<small class="price-tax">{{ 'Incl. VAT' | t }}</small>{% endif %}
</div>
<div class="cart col-xs-7 col-md-7">
<div class="cart">
{% if product.stock.available %}
<input type="text" name="quantity" value="{{ product.quantity }}" />
<div class="change">
<a href="javascript:;" onclick="updateQuantity('up');" class="up">+</a>
<a href="javascript:;" onclick="updateQuantity('down');" class="down">-</a>
</div>
<a href="javascript:;" onclick="$('#product_configure_form').submit();" class="btn glyphicon glyphicon-shopping-cart" title="{{ 'Add to cart' | t }}" {% if shop.language == 'de' %}style="padding: 0px 10px;"{% endif %}>
<span>{{ 'Add to cart' | t }}</span>
</a>
{% endif %}
</div>
</div>
</div>