Forked from anilmeena/display-variants-dropdown-shopify-collection.liquid
Created
October 29, 2018 08:04
-
-
Save aaliyan111/4e8e6198404c85e95caa1aada972859a to your computer and use it in GitHub Desktop.
Shopify Display Multiple Variant Drop-down on Collection Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="/cart/add" method="post" style="text-align:center;"> | |
<select name="id"> | |
{% for variant in product.variants %} | |
{% if variant.available %} | |
<option value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money }}</option> | |
{% else %} | |
<option disabled="disabled">{{ variant.title }} - Sold Out</option> | |
{% endif %} | |
{% endfor %} | |
</select> | |
<input type="submit" value="Buy now" /> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment