Is there a way to get a free gift added to the cart when a specific coupon code has been used? It would be nice if the gift would be a product that is in the catalog, with a unique SKU.

Possible scenario:

A buyer uses the code WANTGIFT while in the cart. At the end of the checkout he will see an additional product with a cost of 0.00 in the checkout summary. After the sell the store will automatically reduce the stock of free gift by 1.

Any suggestions if it is possible with Magento 1.5 or does anyone know a good extension that does the job?

  • I've used the module Promotional Gift made by Magestore once, it worked, but the underlying code is really crappy as hell... So altering/extending it for other needs was a really tough job.
    – 7ochem
    Commented Mar 24, 2015 at 13:36

4 Answers 4


Yes this is possible but you need to create an extension.


You have to rewrite the following block "promo_quote_edit_tab_actions".by overrideing this you can able to place free product selection code in action dropdown while creating coupon code. Also place text field to enter SKU of the product insert this SKU in database "salesrule" table


For front end functionality write down event observer "salesrule_validator_process" in which do code if coupon code applied and if some SKU is assigned via admin then add product into cart.


This free module will do exactly what you want - place a custom free or discounted product into the cart when a definable coupon is detected.



There is a lightweight extension for exactly this scenario: C4B_FreeProduct

It adds a new shopping cart price rules action "free product" where you can enter qty and sku.

screenshot admin

These products are added to the cart as non editable items with price 0 during sales rule validation.

screenshot cart

How it works

  • A new rule type is added to the sales rule form, in an observer on adminhtml_block_salesrule_actions_prepareform
  • An observer on salesrule_validator_process processes the new rule type. It adds the configured SKU to the cart and sets a custom price of 0 and a custom option that identifies the product as free gift.
  • Another observer on sales_quote_collect_totals_before removes existing gift items from the cart (that's what the custom option from before is for), before the rules are processed.
  • The cart item template is adjusted to remove qty input and "remove" link from gift items (they would not work anyways).

Disclaimer: I was involved in the development of this extension.

I am not sure about 1.5 compatibility but as I know the code of the extension, I would expect only minor issues


Same issue here. I just tried [https://github.com/code4business/freeproduct][1] as mentioned by Fabian Schmengler and works for me in Magento 1.9. But the issue is when I add the coupon code in the checkout form (OScheckout), it doesn't update cart items until I refresh the page. Is there a way to fix this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.