The Tapcart Gift with Purchase feature allows users to add a free gift to their checkout upon reaching a certain cart threshold.

IMG_5010.PNG
IMG_5011.PNG
IMG_5013.PNG
important-note_3x.png

Requirements:

Your store needs to be on Shopify Plus to use Shopify Scripts in order to access this feature.

Instructions:
1. Start by creating a collection and populate it with products that are to be included in the Gift Engine feature.
2. Send the Collection ID to your Tapcart account manager.
3. Install the Metafields2 App in the Shopify Dashboard
4. Create meta field namespace and key for threshold:

-- 4a. c_f should be the namespace

-- 4b. [p]Gift Threshold Amount should be the key

5. Add the Threshold amount meta field to each product within the collection in cents (i.e. 9000 for a $90 cart threshold to be eligible for a gift)
6. Using the Shopify script editor, add a script to identify “_smgift“:”1” on each product and discount the price if that attribute is applied to a line item.

Here is an example script that you can use:

Input.cart.line_items.each do |line_item|  #line_item.change_properties({"_smgift" => "0"}, { message: "Woot" })    if line_item.properties["_smgift"] != nil      @disc = line_item.properties["_smgift"].to_f      if(@disc == 1)        # Let's assume that 1 = 100% off        @disc = 0      elsif(@disc > 1)        @disc = @disc/100      end      line_item.change_line_price(line_item.line_price * @disc, message: "FREE GIFT")    endendOutput.cart = Input.cartInput.cart.line_items.each do |line_item|  #line_item.change_properties({"_bundle_discount" => "0"}, { message: "Woot" })    if line_item.properties["_bundle_discount"] != nil      @disc = line_item.properties["_bundle_discount"].to_f      if(@disc == 1)        # Let's assume that 1 = 100% off        @disc = 0      elsif(@disc < 1)        @disc = (1-@disc)      end      line_item.change_line_price(line_item.line_price * @disc, message: "Bundle Item")    endendOutput.cart = Input.cart

Finally, please provide us an image like the examples below, which will be within your cart for users to interact with.

FREE_GIFT-01.jpg
unnamed.jpg
Did this answer your question?