Skip to content

Instantly share code, notes, and snippets.

View jeromegv's full-sized avatar

Jérôme Gagnon-Voyer jeromegv

View GitHub Profile
jeromegv /
Last active March 1, 2023 16:40 — forked from freakdesign/
JavaScript function to calculate the total stock value within a Shopify store

Get total stock value of all Shopify products + breakdown of inventory stock value for each product vendor

Refers to the freakdesign blog post.

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.

Added feature

Found this script to calculate the total stock value of my inventory on my Shopify store, which was really useful since Shopify doesn't provide that info out of the box. I quickly realized that I also needed to know the breakdown of my inventory value for each vendor (supplier) and each product type that is on my store. I took the original script from freakdesign, unminified it, then added a few lines to display that info for each vendor.