All things Shopify and commerce
Hi,
Im using DAWN theme and I try to add a notification in the cart for customers to get notified if they add 1 more product to the cart they get x % amount of discount.
Can I do this with coding?
Solved! Go to the solution
This is an accepted solution.
Hi,
This is Richard at PageFly - Shopify Advanced Page Builder app.
You can add this to your `main-cart-items.liquid` file:
{% if cart.item_count == 4 %} <h2 class="title title--primary"> Add 1 more product to the cart to get an x% discount! </h2> {% endif %}
Replace 4 with the amount of items the customer needs in their cart to get the discount, minus 1. So in the code example above, the customer would be getting a discount at 5 items.
I recommend pasting this just below the {% if cart != empty %} line.
Hoping my solution helps you solve your problem.
Best regards,
Richard | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
➜ Optimize your Shopify store with PageFly Page Builder (Free plan available)
All features are available from Free plan. Live Chat Support is available 24/7.
This is an accepted solution.
Hi @myhope
Definitely able to use the code. Follow the instructions below
1. From the Admin page, go to Online Store > Themes
2. Select the theme you want to edit, click the three dots to edit code
3. Under the Section folder, open the main-cart-items.liquid
4. Then place the code below at line 36 after the </div>, see image below for placement
NOTE: Change the text, "Add 1 more product to get a discount"
<h3 class="add--more">Add 1 more product to get a discount</h3>
<style>
.is-empty .add--more {
display: none;
}
h3.add--more {
text-align: center;
color: red;
}
</style>
See the placement here:
Result:
This is an accepted solution.
Hi,
This is Richard at PageFly - Shopify Advanced Page Builder app.
You can add this to your `main-cart-items.liquid` file:
{% if cart.item_count == 4 %} <h2 class="title title--primary"> Add 1 more product to the cart to get an x% discount! </h2> {% endif %}
Replace 4 with the amount of items the customer needs in their cart to get the discount, minus 1. So in the code example above, the customer would be getting a discount at 5 items.
I recommend pasting this just below the {% if cart != empty %} line.
Hoping my solution helps you solve your problem.
Best regards,
Richard | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
➜ Optimize your Shopify store with PageFly Page Builder (Free plan available)
All features are available from Free plan. Live Chat Support is available 24/7.
Thank you for the reply Richard
just 1 more thing, will this reset the message (or remove) when there are 2 or more items in the card without refreshing the page?
Thank you for the reply Richard
just 1 more thing, will this reset the message when there are 2 or more items in the card without refreshing the page?
This is an accepted solution.
Hi @myhope
Definitely able to use the code. Follow the instructions below
1. From the Admin page, go to Online Store > Themes
2. Select the theme you want to edit, click the three dots to edit code
3. Under the Section folder, open the main-cart-items.liquid
4. Then place the code below at line 36 after the </div>, see image below for placement
NOTE: Change the text, "Add 1 more product to get a discount"
<h3 class="add--more">Add 1 more product to get a discount</h3>
<style>
.is-empty .add--more {
display: none;
}
h3.add--more {
text-align: center;
color: red;
}
</style>
See the placement here:
Result:
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025