Shopify themes, liquid, logos, and UX
Hello, is there a way to show how many units are in stock left on the cart page? Same as I have next to the product? When customers want to add units in the cart and they don't know it was the last piece they added. It pops up confusing messages and it isn't clear to customers the last units they have in the cart.
Solved! Go to the solution
This is an accepted solution.
Hello @chefsimecek ,
Goto Online Store -> Edit Theme
Search File 'main-cart-items.liquid'
Add this code after line '<td class="cart-item__quantity'
<p
class="product__inventory no-js-hidden caption-with-letter-spacing"
role="status"
>
{%- if item.product.selected_or_first_available_variant.inventory_management == 'shopify' -%}
{%- if item.product.selected_or_first_available_variant.inventory_quantity > 0 -%}
{%- if item.product.selected_or_first_available_variant.inventory_quantity <= 10 -%}
{{-
'products.product.inventory_in_stock_show_count'
| t: quantity: item.product.selected_or_first_available_variant.inventory_quantity
-}}
{%- endif -%}
{%- endif -%}
{%- endif -%}
</p>
Change this number for Max stock limit
Hello @chefsimecek ,
Yes it is possible, could you share store url, password and cart code.
This is an accepted solution.
Hello @chefsimecek ,
Goto Online Store -> Edit Theme
Search File 'main-cart-items.liquid'
Add this code after line '<td class="cart-item__quantity'
<p
class="product__inventory no-js-hidden caption-with-letter-spacing"
role="status"
>
{%- if item.product.selected_or_first_available_variant.inventory_management == 'shopify' -%}
{%- if item.product.selected_or_first_available_variant.inventory_quantity > 0 -%}
{%- if item.product.selected_or_first_available_variant.inventory_quantity <= 10 -%}
{{-
'products.product.inventory_in_stock_show_count'
| t: quantity: item.product.selected_or_first_available_variant.inventory_quantity
-}}
{%- endif -%}
{%- endif -%}
{%- endif -%}
</p>
Change this number for Max stock limit
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025