Last active
January 3, 2016 09:59
-
-
Save christophergregory/8446930 to your computer and use it in GitHub Desktop.
Shopify wholesale product snippet
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
{% comment %} | |
Tag customers and products with "wholesale" tags. | |
{% endcomment %} | |
{% assign isWholesaleCustomer = false %} | |
{% if customer and customer.tags contains 'wholesale' %} | |
{% assign isWholesaleCustomer = true %} | |
{% endif %} | |
{% assign isWholesaleProduct = false %} | |
{% if product.tags contains 'wholesale' %} | |
{% assign isWholesaleProduct = true %} | |
{% endif %} | |
{% assign showProduct = true %} | |
{% if isWholesaleProduct != isWholesaleCustomer %} | |
{% assign showProduct = false %} | |
{% endif %} | |
{% comment %} | |
Use "showProduct" variable to hide/show products | |
{% endcomment %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment