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 |
---|---|
176 | |
160 | |
77 | |
31 | |
30 |
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023