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 PDventures, 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.
Best,
Tobe
This is an accepted solution.
Hi PDventures, 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.
Best,
Tobe
Thank you for the reply Tobe.
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?
The entire page will not refresh. In Dawn, when the cart is updated, just the `main-cart-items` section reloads, from what I can tell.
Thank you it worked
Is there a way to center it and change the color of the text?
Yes, you can use CSS. Try the `text-align` and `color` properties. I recommend using ChatGPT to add these styles to the code I gave you.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025