How to Add Free Gifts Automatically to the Cart
The Gifting feature in Dollarlabs Pricelist allows you to automatically add a free product to the customer’s cart when they purchase a specific product, variant, collection, or any item.
This is perfect for “Buy X, Get Y” promos, freebie campaigns, etc!
What the Gifting Feature Does
With gifting, you can set up rules such as:
Buy this product → Automatically receive a free gift product in the cart
Scale gifts based on quantity (e.g., buy 3 → get 3 gifts)
Add multiple free gifts
Limit gift quantity using a maximum cap
Show “Free Gift” messaging directly on your product page using our Theme Blocks
How to Set Up a Gifting Rule
1. Setup an offer on the Offer engine (Price list)
Go to your Dollarlabs Discount App
Click Configure Pricelist
Choose or create the pricelist you want to add the gifting rule to
2. Configure the Trigger Product
Inside the pricelist:
Add a new rule
Choose where the rule applies:
A specific product
A variant
A collection
Or any purchase
Example: You select Variant ABC as the product that triggers the gift.
3. Add the Gift Product
Scroll to the Gift Products section:
Click Add Gift Product
Select the product and variant you want to offer as a free gift (example: Product ID 1001)
You can add more than one gift by clicking Add Gift Product again.
4. Enable “Gift Scales With Quantity” (Optional)
You have two ways to apply gifts:
Option A: Fixed Gift (No Scaling)
Customer buys 1 or 5 units → they receive only 1 gift
Option B: Scale Gifts With Quantity
Toggle Gift scales with quantity ON if:
Buy 1 → get 1 gift
Buy 3 → get 3 gifts
Buy 10 → get 10 gifts
You can also set a maximum cap. Example:
Gift scales with quantity = ON
Maximum gift quantity = 10
Even if the customer buys 21 units, only 10 gifts will be added.
5. Enable Required Theme Blocks
To make gifting work on your storefront, two theme blocks must be active:
A. Gift Block (Product Page)
Shows the “Free Gift” message on the product page for eligible variants.

B. Code Embed (Cart Logic)
Ensures the gift is automatically added to and synced in the cart.
To enable:
Click Add Block & Activate
Dollarlabs automatically adds the blocks inside your theme
Move the Gift Block to where you want it (usually near variant selector)
Click Save
Once activated correctly, these blocks will show a green status inside the Pricelist editor.
6. Test the Feature
A. On the Product Page
Switch to the eligible variant — you should see a message like “You will receive Product 1001 for free.”
Switch to a non-eligible variant — no gift message will appear.
B. In the Cart
When you add the product to the cart:
The gift is automatically added as a free line item.
If scaling is OFF: gift stays at 1.
If scaling is ON: updating the quantity updates the gift quantity.
If quantity exceeds the max cap: gift remains at the capped number.
Adding unrelated variants/products will not affect the gift.
Advanced: Using Window Variables (For Custom Themes)
If you prefer to render your own custom gift UI, you can use the global object:
window.DOLLAR_VARIANT_GIFTSThis contains:
All variants for the current product
Whether the variant is eligible
The list of gift products
Quantity scaling data
Maximum caps
You can use this to design your own custom gift badges, blocks, or banners.
Current Limitations
Currently supported:
Product-based gifting
Variant-based gifting
Collection-based gifting
“Any purchase” gifting
Not yet supported (coming soon):
Cart value–based gifting (e.g., “Spend $100 → Get Gift”) This is under development.
Need Help?
If you have questions or want us to set this up on your store:
📩 Email us at [email protected] or simply ping us on chat :)
Last updated