Created
March 8, 2014 05:55
-
-
Save zakhardage/9426003 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Existing Form | |
| <form action="http://bridal-survival.myshopify.com/cart/add" method="post"> | |
| <input type="hidden" name="id" value="{{ variant.id }}" /> | |
| <input type="hidden" name="return_to" value="back" /> | |
| <input class="buy" type="submit" value="{{ variant.id }}" /> | |
| </form> | |
| // New Form | |
| {% if customer and customer.tags contains 'wholesale' %} | |
| {% for variant in product.variants reversed %} | |
| {% if variant.title contains 'wholesale' %} | |
| {% assign variantID = variant.id %} | |
| {% endif %} | |
| {% endfor %} | |
| {% else %} | |
| {% for variant in product.variants reversed %} | |
| {% unless variant.title contains 'wholesale' %} | |
| {% assign variantID = variant.id %} | |
| {% endunless %} | |
| {% endfor %} | |
| {% endif %} | |
| <form action="http://bridal-survival.myshopify.com/cart/add" method="post"> | |
| <input type="hidden" name="id" value="{{ variantID }}" /> | |
| <input type="hidden" name="return_to" value="back" /> | |
| <input class="buy" type="submit" value="{{ variant.id }}" /> | |
| </form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment