Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I'm setting up a collection page for a wholesale client that wishes to see the total value of all the inventory for an item.
I am therefore looking to add on the collection page below each product name and price a total value for price times inventory number.
What code would I need to add to do this?
The collection page url - https://www.776bc.com/collections/rowing-australia-warehouse-stock
Thanks.
Hi,
I think you are looking for something like this:
{% capture total_value %} {{ product.first_available_variant.inventory_quantity | times: product.first_available_variant.price | money }} {% endcapture %}
And then you can print the text with:
{{ total_value }}
Note that this code probably won't work with multiple variants.
Thanks! Would there be anyway to have it working for products with multiple variants?
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025