Imagine you are running a store where you sell a limited number of products – you could be selling artwork, or running a W00t! style business. For this type of business, it is critical that you understand how your ecommerce system manages your inventory when customers add the items to the cart, and checkout. Most importantly, what happens if a customer abandons the order? Does the item get returned to inventory or is it no longer available?

So how does it work in Shopify? First, an item is deducted from inventory when the checkout process begins. It is not removed when it is added to the cart. In the early days of Shopify the only way to deal with abandoned items was to log in to Admin and look at your abandoned orders (you can see these by clicking on “abandoned” under Orders > Payment Status). Nowadays, it is handled differently. After five minutes, the item is returned to inventory.

On the technical side, it is possible to show if there any items available in your product and collection pages using {{ product.available }} in the liquid templates. You can also display how many items there are of each variant using {{ variant.inventory_quantity }}.

Here is an example from the wiki page:

{% if variant.available == true %}
   We currently have {{ variant.inventory_quantity }} in stock.
{% else %}
   Sold out!
{% endif %}

Bonus Tip: you can access an xml file that has your abandoned orders in it using this url: http://[yourshop]/admin/orders.xml?status=abandoned It will prompt you to login with your administration email and password if you aren’t already logged in.