Re: Notify customers they need to add 1 more item to the cart to get a discount

Solved

Notify customers they need to add 1 more item to the cart to get a discount

myhope
Excursionist
16 0 1

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?

Accepted Solutions (2)

PageFly-Richard
Shopify Partner
5011 1120 1803

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.

View solution in original post

Made4uo-Ribe
Shopify Partner
10202 2422 3067

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:

Made4uoRibe_0-1729095426135.png

 

Result:

Made4uoRibe_1-1729095452600.png

 

 

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.

View solution in original post

Replies 4 (4)

PageFly-Richard
Shopify Partner
5011 1120 1803

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.

myhope
Excursionist
16 0 1

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?

myhope
Excursionist
16 0 1

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?

Made4uo-Ribe
Shopify Partner
10202 2422 3067

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:

Made4uoRibe_0-1729095426135.png

 

Result:

Made4uoRibe_1-1729095452600.png

 

 

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.