Incentivize cutomers by providing a gift with purchase in-app! With Tapcart's Gift with Purchase, feature you can allow users to add a free gift to their checkout upon reaching a certain cart threshold.
How to Configure Your Gift with Purchase Collection?
Steps
- Start by creating a collection and populate it with the products that will be offered as the free gift during checkout.
- Publish the collection and the included products to the Tapcart Mobile App sales channel.
- Install the Metafields Guru App in the Shopify Dashboard
- Metafield - This is a variable you set on each free product that Tapcart will query to determine gift eligibility.
- In the metafield, we are trying to determine if the product has met the threshold to be added as a gift.
- Create metafield namespace and key for threshold
- For more information on how to create the metafields, check out this guide here.
- Expose meta fields to the Storefront API via this guide here.
- Add the same namespace and key values that you used on the free gifts under the Products tab.
- Add the same namespace and key values that you used on the free gifts under the Products tab.
- Once your metafields are created and assigned to the free gift products, use the Shopify script editor to add a script to identify “_smgift“:”1” on each product and discount the price if that attribute is applied to a line item.
- The Script Editor app from Shopify must be installed and the script below will be for Line Items. It can be added to an existing script.
- Important Note: The script will need to be published to the 'Online Store and Storefront API channels'
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")
end
end
Output.cart = Input.cart
Input.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")
end
end
Output.cart = Input.cart
How to Set Up Gift with Purchase in Your Tapcart Dashboard?
Once you've completed the steps above, you can navigate to your Tapcart Dashboard to adjust your app settings.
Steps
- Navigate to your 'App Settings' within your dashboard
- Scroll down to 'Cart & Checkout'
- Turn on 'Gift with Purchase'
- Upload the cart banner image and select the collection that contains your gift(s)
- Select 'Save & Update' and you're all set!
- Important Note: The recommended banner size is 1542 x 498px
Considerations
We recommend the Metafields Guru App in the Shopify Dashboard but if you are using another third-party metafields app that will work as well!
Please note, your store needs access to Shopify Scripts in order to access this feature. Shopify Scripts is only available on Shopify Plus. For more information on Shopify’s Plus plan, please visit this link.
More Questions
To learn more about Tapcart, visit Tapcart Academy to become a mobile app expert!
If you have additional questions about setting up ‘Gift with Purchase', we’re happy to help! Please reach out to us through LiveChat in your Tapcart dashboard or you can email us at help@tapcart.co!