Reputation: 43
I am attempting to set up a limited number run of products for sale in a Squarespace shop and need to display how many are left of an item in stock. How do I go about doing this?
Original unanswered question in the squarespace forums: http://answers.squarespace.com/questions/5588/is-there-a-way-to-add-a-quantity-left-of-a-product-for-customers-to-see
Storenvy already does it with an availability bar: http://storenvythemes.storenvy.com/products/758448-mobile-friendly-storenvy-theme-camellia-improved
Upvotes: 0
Views: 2020
Reputation: 12943
You can access the JSON quantity object in the product single page this way:
{website.items.0.variants.0.qtyInStock}
This will return you how many items you have available for the first variant of the product.
But you will have to tweak the product.item file (or create one if you don't have it).
Another way is to use javascript to get the JSON code of the page and parse it down to the Quantity object.
Upvotes: 1