Calculating total sales value for Shopify products

Hey everyone,

I’m trying to figure out how to show the total value of sold items on my Shopify store. Here’s what I mean:

Let’s say I’ve got a collection with 10 products. Each one costs $20. So far, 6 of them have been sold.

I want to display the total sales value somewhere on my site. In this case, it would be:

6 (sold items) x $20 (price per item) = $120 (total sales value)

Is there a way to set this up automatically? It would be super helpful to have this info visible on any page of my store.

Has anyone done something like this before? Any tips or advice would be awesome. Thanks!

hey creativePainter33, I’ve done smthing similar b4. u can use shopify’s liquid templating to calc this. create a snippet that loops thru sold products, multiplies quantity by price, and sums it up. then include that snippet wherever u want. might need some js for real-time updates tho. good luck!