Adding free gift to cart when checkout total is more than $25

Solved
New Member
4 0 0

Hi @PaulNewton thanks for your reply - unfortunately I do not have plus plan.

0 Likes
Shopify Partner
2569 133 433

Then you will need to either set the free gift to be $0, or make an automatic discount code that will make it $0 which means customers will not be able to use other discounts. 

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes
New Member
1 0 0

Hi @jayanetty , can you instruct how to add free product when the customers purchase specific group of product? 

Thank you for your blog!

 
 
 
 
0 Likes
New Member
1 0 0

I have the same concern 

0 Likes
Tourist
5 0 1

Quick question. Iʻm not on the Plus plan but got the code (Follow this, https://jayanetty.com/blog/give-free-product-using-shopify-script-editor/) to work by making the price $0. BUT, when I tested the code I noticed that if the price in the cart falls below my threshold-$100 in my case- the FREE product remains in the cart. Is there a way to prevent this?

 

thx.

 

~steve

0 Likes
Pathfinder
111 11 33

Hi @steve79 Glad that helped. Yes there is a way to prevent it.

Add this to the else condition.
cartUpdates = { {{ variant_id }}: 0 }

and wrap the whole code inside a session key. This is to break the loop.

So basically, remove the session key whenever a href/button is clicked, and add the session key when the script is run once. Hope this helps

0 Likes
Tourist
5 0 1

Not sure how to wrap the whole code in a session key. A little help would be great.

 

I know enough about coding to fix minor things, but things can get dangerous very quickly. 

0 Likes
Shopify Partner
2569 133 433

@steve79 wrote:

Quick question. Iʻm not on the Plus plan but got the code (Follow this, https://jayanetty.com/blog/give-free-product-using-shopify-script-editor/) to work by making the price $0. BUT, when I tested the code I noticed that if the price in the cart falls below my threshold-$100 in my case- the FREE product remains in the cart. Is there a way to prevent this?


You need to try and evaluate what the final price would be BEFORE you actually apply the discount then skip it when it's below your threshold.

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes
Tourist
5 0 1

Hi. Can you let me know how to wrap the whole code inside a session key?

I donʻt have enough coding knowledge to do this.

Thanks.

0 Likes