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
jeromegv / index.html
Last active September 24, 2015 21:15
Tilestache on XSCE stack
<html>
<head>
<title>Sample: Adding Tilestache to Leaflet</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" /><![endif]-->
<script src="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
<script>
$(document).ready(function(){
@jeromegv
jeromegv / get-total-stock-value.md
Last active March 1, 2023 16:40 — forked from freakdesign/get-total-stock-value.md
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.