Skip to content
REFIERE JONYTIPS Y GANA COMISIONES! 💸 OBTÉN TU LINK DE REFERIDO 🔗 HAZ CLICK AQUÍ 🖱️ REFIERE JONYTIPS Y GANA COMISIONES! 💸 OBTÉN TU LINK DE REFERIDO 🔗 HAZ CLICK AQUÍ 🖱️ REFIERE JONYTIPS Y GANA COMISIONES! 💸 OBTÉN TU LINK DE REFERIDO 🔗 HAZ CLICK AQUÍ 🖱️

Cart

Your cart is empty

Article: Show how many units are left on the product sheet

Mostrar cuántas unidades quedan en la ficha del producto

Show how many units are left on the product sheet

For those who have templates in their visual editor It does not have the option to show how many units are left of the product, I share the code that you need to paste into your product.liquid or product-template.liquid depending on the template.

Those who have a turbo, this element is located here

The position where you put this code will depend on your template since it will depend on whether you want it above the price or after the purchase button, etc. . So that they don't mess up, never paste it between purple lines since they are generally programming paragraphs that have a beginning like if and an end like endif or endunless and we don't want to make the page. In any case, above each editor are the versions in case we want to go back or do an undo edit. You can paste this code and see on your website where the element is on your page.

<p> {% assign total=0 %} {%for variant in product.variants %} {% capture i %} {{ total | plus:variant.inventory_quantity }} {%endcapture%} {% assign total = i %} {%endfor%} <b>Available Units: </b> {{ total }} </p>

The result would be something like this, it will depend on your staff and where they place it.

Leave a comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

All comments are moderated before being published.

Read more

Agregar labels en la grilla de productos de tu Shopify sin apps

Add labels to your Shopify product grid without apps

This type of requirement is very common since many times we do not want to show the % discount in the product gallery but rather we want to put a symbol of a specific event or highli...

Read more
Autenticar tu correo para no caer a SPAM con Shopify y servicios de Mailing

Authenticate your email to avoid SPAM with Shopify and Mailing services

This is a common problem that occurs on some poorly configured websites where it has not been possible to provide all the validations so that the services and your website understand that it is ...

Read more