Re: Product Total Value

How can I display the total value of inventory on a collection page?

776BC
Tourist
5 0 3

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.

Replies 2 (2)

Bitfresh
Shopify Partner
57 10 12

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.

776BC
Tourist
5 0 3

Thanks! Would there be anyway to have it working for products with multiple variants?