Most people that need to know the total stock value are already likely to be using a third party Inventory Management System, ERP (or similar). If you want to know what your total stock value is you can grab that info via the API - let's look how.
The logic is pretty simple:
- Grab all the products in the store
- Loop over the variants
- Get the price for each variant
- Times the price by the inventory amount
- Add that amount to the global amount.
^ Once we're at the end of the loop we'll have the master total.
Important note: A product that you don't track inventory on will be excluded from the results.
Paste this into the debug console. Run, wait, success (hopefully)!
Assuming it all worked you should see something like this: