Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save chikaibeneme/b24a4980c8bd9587024d850e03476721 to your computer and use it in GitHub Desktop.

Select an option

Save chikaibeneme/b24a4980c8bd9587024d850e03476721 to your computer and use it in GitHub Desktop.
{% if product.variants.size > 0 %}
<form action="/cart/add" method="post" enctype="multipart/form-data" class="product-form product">
<input type='hidden' name='id' value="{{product.selected_or_first_available_variant.id}}" />
<input type='hidden' name='quantity' value="1" />
<button type="submit" name="add" {% unless product.available %} disabled {% endunless %} class=" {% unless product.available %} disabled {% endunless %} btn product-form__cart-submit{% if product.options.size == 1 and product.variants[0].title == 'Default Title' %} product-form__cart-submit--small{% endif %} btn-primary btn-sm btn-lg">
<span>
{% if product.available %}
{{ 'products.product.add_to_cart' | t }}
{% else %}
{{ 'products.product.sold_out' | t }}
{% endif %}
</span>
</button>
</form>
{% else %}
{% if section.settings.use_quick_view %}
{% include 'product-quick-view-btn', buttonType:"red" %}
{% endif %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment