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

Solved
jayanetty
Shopify Partner
123 12 38

I want to gift my customers a free product if their total checkout is more than $25. Could I achieve this using Script editor line items?

Everyone deserves a win!
Accepted Solution (1)

Accepted Solutions
jayanetty
Shopify Partner
123 12 38

This is an accepted solution.

Hi @malmeida ,

Follow this, https://jayanetty.com/blog/give-free-product-using-shopify-script-editor/

Let me know if you come across any difficulties.

Everyone deserves a win!

View solution in original post

Replies 54 (54)
raviranjan1078
Excursionist
15 2 3

Hi @jayanetty ,

Yes you can do it using javascript. Even you can make it configurable using section settings.

jayanetty
Shopify Partner
123 12 38

Thanks @raviranjan1078. I got it to work 🙂

Everyone deserves a win!
adam_bn
Shopify Partner
71 3 11

An easy no-code solution would be the Gifter: Auto Add to Cart app, which lets you set up rules that automatically add another product to the customer's cart (based on what products they are buying, or how much their cart value is, etc).

 

There's a free trial as well: https://apps.shopify.com/gifter-cart-auto-include

Reincarnated
Pathfinder
103 8 31

I myself stay away from apps when ever possible.  I have this coded directly into my themes.  You can see it in a Demo here:

 

https://demo.ecomdev.ca/

Adam_Čvikota
Shopify Partner
16 0 2

Hello,
if you need to offer free gifts if checkout total is more than XY, you can try to use this app:
https://apps.shopify.com/sales-motivator-free-gifts
 
You have 7 days trial there and app works on all devices.

bumbastic
Explorer
50 1 13
Not available anymore? :x
jayanetty
Shopify Partner
123 12 38

Hi @bumbastic


Do you want to add a free product? Are you a Shopify plus user?

Everyone deserves a win!
bumbastic
Explorer
50 1 13

Hi, yes I do want to add a free gift automatically, I have the basic plan though.

Right now I can add a discount rule of course but this implies the client has to add the product manually  in order to receive the free gift...

I would like it to be added automatically

jayanetty
Shopify Partner
123 12 38

How I did it was using AJAX to inject the product. 
Get the product variation ID you want to give free and inject if the conditions are true. In my scenario, the cart total had to be more than $25. 

Do you know AJAX and Liquid coding? 

Everyone deserves a win!
bumbastic
Explorer
50 1 13

Not really, I mean i can copy paste a code 😛 but that's about it 

Apoorva
Shopify Partner
20 0 0

Hey 

I want to send some gifts to the customer so it can add automatically in cart with 0 value or customers don't want it and can remove it.
Have you solve can you let me know how I can achieve this.
 

malmeida
Tourist
6 0 1

Hi! I tried to see your custom cart code but the link is not working 😕

jayanetty
Shopify Partner
123 12 38

This is an accepted solution.

Hi @malmeida ,

Follow this, https://jayanetty.com/blog/give-free-product-using-shopify-script-editor/

Let me know if you come across any difficulties.

Everyone deserves a win!
malmeida
Tourist
6 0 1

Thank you so much!!! I'll definitely try it. That's exactly what I as looking for 🙂

malmeida
Tourist
6 0 1

This is only available to Shopify Plus plans.  Any other suggestions? I'm not on that plan. 

jayanetty
Shopify Partner
123 12 38

Hi @malmeida,

Duplicate the product you want to give for free, make its price zero and inject via Ajax as shown in that tutorial. 

Everyone deserves a win!
PaulNewton
Shopify Partner
4211 303 902

You can repurpose the gift wrapping customization to do this https://shopify.dev/tutorials/customize-theme-add-gift-wrap-option

Or use the ajax api endpoints to add and item to the cart using the variant.id

 

{% assign variant_id = allproducts[PRODUCTHANDLE].first_available_variant }}
https://customizations.myshopify.com/cart/add/?id={{variant_id}}

or https://customizations.myshopify.com/cart/update/?updates[{{variant_id}}]

or https://customizations.myshopify.com/cart/update/?updates[{{variant_id}}]=1

 

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
BenRourke
New Member
3 0 0

Hi @jayanetty We have a slideout cart. Would your fantastic tutorial work with this? Best wishes, Ben. 

jayanetty
Shopify Partner
123 12 38

Hi @BenRourke,

I've not included the mini cart code since it differs from theme to theme.

Everyone deserves a win!