similar to a “sold out” badge but I would like to add-on another badge called “last piece” and only display 1 badge at a time. so for example if the product left 1 piece, it will show “last piece” and if it’s sold, it will show “sold out”
im currently using taste theme by shopify
https://twoofusco.store/
1 Like
Hi @twoofusco ,
We do have to use similar code to show the badges.
{% assign current_variant = product.selected_or_first_available_variant %}
{% if current_variant.available %}
{% if current_variant.inventory_quantity == 1 %}
Last Piece
{% endif %}
{% endif %}
Please don’t hesitate to reach out if you need further help optimizing or customizing your store. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
LuffyOnePiece
Hello @twoofusco ,
I understand you are looking to provide a ‘Last Piece’ badge similar to the ‘Sold Out’ badge in the products with less quantity or only 1 item left.
You can use a Shopify app to add different badges.
As with the help of this app https://apps.shopify.com/easy-stock , you can add a ‘Only 1 left’ badge over the product images, kindly take a look.
I hope it helps.
Thank you.
hi @LuffyOnePiece ! thank you, may I know which file should I paste this code to? And how do I change the colour for the label as well?