Show inventory on the cart page
If you want to show the inventory of products on the cart page you need to enable that feature in the advanced options settings.
You also will need to add some code to your theme. You will need to find the for which loops over the items in the cart-template
.
Add the following code in a div like it is done in the image below:
data-tomit-product-id="{{item.product_id}}" data-tomit-variant-id="{{item.variant_id}}"
If the inventory isn't shown right, you can place the code in a different element. You can also place the code in a div and put that element in your file.
<div data-tomit-product-id="{{item.product_id}}" data-tomit-variant-id="{{item.variant_id}}"></div>
We recommend turning on the cache feature because with the inventory shown on your cart page we reach the API limit of Shopify faster than usual.
If you require technical assistance, we recommend reaching out to some of the Shopify Experts.
Last updated