Hello, is it possible to add a progress bar like the attached to the ‘featured product’ using custom liquid? cant see to find any decent apps. Thanks
![]()
A user seeks to add a stock inventory progress bar to Shopify’s ‘featured product’ section using custom Liquid code, avoiding third-party apps.
Solution Provided:
product.variants.first.inventory_quantityCurrent Issue:
The user implemented the code but reports two problems:
Status: The discussion remains open with the user requesting additional help to fix the implementation. One responder offered further guidance for the exact implementation.
Hello, is it possible to add a progress bar like the attached to the ‘featured product’ using custom liquid? cant see to find any decent apps. Thanks
![]()
hey @DASCPA Yes! You can add a progress bar in Shopify using Custom Liquid and CSS.
Go to Online Store > Themes > Customize
Select the Featured Product section
Add a Custom Liquid block
Paste this code:
{% assign total_stock = 1000 %}
{% assign sold_stock = 250 %}
{% assign remaining_stock = total_stock | minus: sold_stock %}
{% assign percentage_remaining = remaining_stock | times: 100 | divided_by: total_stock %}
Hurry! Only {{ remaining_stock }} Tickets Remaining
Go to Online Store > Edit Code
Open base.css or theme.css
Add this at the bottom:
.progress-bar-container {
width: 100%;
background-color: #ddd;
border-radius: 5px;
height: 10px;
margin-top: 5px;
}
.progress-bar {
height: 100%;
background-color: #28a745;
border-radius: 5px;
transition: width 0.5s ease-in-out;
}
{% assign total_stock = product.variants.first.inventory_quantity | plus: 250 %}
{% assign sold_stock = 250 %}
Hi @DASCPA ,
I hope you’re doing well!
Yes, it’s absolutely possible to integrate a progress bar into the Featured Product section using custom Liquid code. You can achieve this by dynamically calculating the progress based on inventory levels or sales data. Since Shopify allows customization through Liquid, you can implement this without needing an app.
If you need help with the exact implementation, We’d be happy to guide you! ![]()
Regards,
Hello, Thank you for the above. this has partly worked. However the progress bar is not highlighted in green indicated the amount of inventory on stock and the amount is wrong. I have followed the above, see here.
Hi Laurent, thanks for your message, yes if you do have the code for this that would be great. Thank you