Skip to content

Instantly share code, notes, and snippets.

@christophergregory
Last active January 3, 2016 09:59
Show Gist options
  • Save christophergregory/8446930 to your computer and use it in GitHub Desktop.
Save christophergregory/8446930 to your computer and use it in GitHub Desktop.
Shopify wholesale product snippet
{% 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