Skip to content

Instantly share code, notes, and snippets.

View sandyparihar07's full-sized avatar
🎯
Focusing

Sandeep Parihar sandyparihar07

🎯
Focusing
View GitHub Profile
{% assign section_collection = section.settings.collection %}
{% unless cart.item_count == 0 %}
{% assign product_collection_qty = 0 %}
{% for line_item in cart.items %}
{% for line_item_product_collection in line_item.product.collections %}
{% if line_item_product_collection.title == section_collection.title %}
{% assign product_collection_qty = product_collection_qty | plus: line_item.quantity %}
{% if product_collection_qty >= 3 %}
{% assign show_gifting_product = true %}
{% endif %}
<form method="post" action="/cart/add" style="text-align: center">
<input type="hidden" name="id" value="{{ product.variants.first.id }}">
<input min="1" type="number" id="quantity" name="quantity" value="1"/>
<input type="submit" value="ADD TO CART" class="btn">
</form>