Shopify themes, liquid, logos, and UX
How do I get my collections pages to show the quantity of the items? I want the collections pages to show the quantities of the items in grid view so the customer doesn't have to click into the item to see how many units there are.
Solved! Go to the solution
This is an accepted solution.
Hi @jschenck ,
Follow the below steps:
{% assign total_inventory = 0 %}
{% for variant in card_product.variants %}
{% assign total_inventory = total_inventory | plus: variant.inventory_quantity %}
{% endfor %}
({{ total_inventory }})
Please don't hesitate to reach out if you need further help optimizing or customizing your store. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
LuffyOnePiece
This is an accepted solution.
Hi @jschenck ,
Add the below code to make Available in the new line.
{% assign total_inventory = 0 %}
{% for variant in card_product.variants %}
{% assign total_inventory = total_inventory | plus: variant.inventory_quantity %}
{% endfor %}
<br/> Available: {{ total_inventory }}
We can't add the filter for the Quantity in the sorting.
Thank you
This is an accepted solution.
Hi @jschenck ,
Follow the below steps:
{% assign total_inventory = 0 %}
{% for variant in card_product.variants %}
{% assign total_inventory = total_inventory | plus: variant.inventory_quantity %}
{% endfor %}
({{ total_inventory }})
Please don't hesitate to reach out if you need further help optimizing or customizing your store. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
LuffyOnePiece
Thank you, @LuffyOnePiece! I have 2 follow-up questions:
Thanks again!
This is an accepted solution.
Hi @jschenck ,
Add the below code to make Available in the new line.
{% assign total_inventory = 0 %}
{% for variant in card_product.variants %}
{% assign total_inventory = total_inventory | plus: variant.inventory_quantity %}
{% endfor %}
<br/> Available: {{ total_inventory }}
We can't add the filter for the Quantity in the sorting.
Thank you
Hello Luffy,
I followed your instructions and I can't get this to work.
I am trying to get my total invnetory amount to show on my collections presentations.
Here is the code I used from this discussion:
{{ card_product.title | escape }}
{% assign total_inventory = 0 %}
{% for variant in card_product.variants %}
{% assign total_inventory = total_inventory | plus: variant.inventory_quantity %}
{% endfor %}
({{ total_inventory }})
</a>
</h3>
</div>
Any ideas?
Here is a screen cap of the collection presentation
Here is what shows when I click on a product
The site is GolfballMonster.com
I am using Dawn 15.1.0
Thanks!
Hi @DecoDean1 ,
Can you please let me know which theme you are using so that I can help you out?
Thank you
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024