Last active
December 27, 2015 11:29
-
-
Save keirwhitaker/7318818 to your computer and use it in GitHub Desktop.
Lists all products and variants along with a cart permalink that will add one of that variant to the cart
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
<h2>Products Cart Permalinks</h2> | |
{% for product in collections.all.products %} | |
<h3>{{ product.title }}</h3> | |
<ul> | |
{% for variant in product.variants %} | |
{% if variant.available == true %} | |
<li> | |
<a href="{{ shop.url }}/cart/{{variant.id}}:1">{{ variant.title }} / {{ variant.price | money }} ({{ variant.inventory_quantity }} left)</a> | |
<input type="text" value="{{ shop.url }}/cart/{{variant.id}}:1" size="100"> | |
</li> | |
{% endif %} | |
{% endfor %} | |
</ul> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment