Shopify themes, liquid, logos, and UX
How do I show the quantity of items sold on the product page? So that the quantity in stock is equal to that of sold + 1..
I use the code like this, but every time there is a sale, the value goes down xD
{% assign product_qty = 0 %}
{% for variant in product.variants %}
{% if variant.inventory_quantity > 0 %}
{% assign product_qty = product_qty | plus: variant.inventory_quantity %}
{% endif %}
{% endfor %}
{% if product_qty > 0 %}
{{ product_qty }} sold.
{% endif %}
User | RANK |
---|---|
196 | |
152 | |
79 | |
75 | |
63 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023