Has anyone tried working with the free gift line scripts on the checkout page with the discount code? I’m trying to add the gift item(s) to the cart whenever users insert a specific discount code but I noticed from the shopify documentation line item script, it only works if the free gift item is in the cart as well.. can i insert the discount code and the free gift will appear as well on
It might be a bit late, but if you still haven’t found a solution, I’m happy to share one.
Since Shopify’s native discount system doesn’t support automatically adding free gifts to the cart, the most reliable way to achieve this is by using a third-party app. One option you can consider is the BOGOS: Free Gift Bundle Upsell.
With BOGOS, you can set up a checkout upsell offer and set the upsell item’s discount to 100%, making it a free gift. (Note: This feature is available for Shopify Plus stores only.)
Then, you simply combine it with the discount code you created in Shopify’s native discount settings. This setup allows you to apply a discount code and have the free gift automatically added to the cart.
Shopify’s native discounts do have this limitation; the free gift item needs to already be in the cart for the script to apply the offer. There’s no way to trigger an auto-add purely based on a discount code entry.
Monk Free Gift handles this exact setup though. When a customer enters a specific code at the checkout, the free gift gets automatically added to their cart without them having to do anything manually.
You can also layer in additional eligibility criteria on top of the code trigger, which makes it quite a flexible setup:
Free gift auto-adds when the code is entered AND cart value is above a certain threshold (e.g. $50)
Free gift auto-adds when the code is entered AND the customer has a minimum number of items in cart (e.g. 2 products)
So the discount code acts as one condition, and you can stack others on top of it depending on how targeted you want the offer to be.
The reason your “Occasion Type” and “Occasion Date” aren’t showing in order admin is that the fields need to be inside the product form and use Shopify line item properties.
Make sure your input names are formatted like this:
The inputs must sit inside the <form> tag (the one with product-form / add to cart), otherwise the data won’t pass through.
Use the exact properties[Field Name] format — that’s what tells Shopify to save it to the line item.
Once done, the values will appear under the product’s line item details in the order admin.
If you’d rather not edit Liquid code, a product-options app (like Easify or similar) can do this automatically and save inputs to cart, checkout, and order admin.
Want me to show you exactly where to place these in the Craft theme’s product section?