Is it possible in the shopping cart price rules to create a rule that gives you a rule like "buy amount X of Product A, get 1 Product B for free"?

For example:

buy 8 of SKUs 123, 124 or 125, get SKU 126 Free


3 Answers 3


The feature you're looking for is a free gift/auto free gift/promo items functionality. Magento does not come with this feature out of the box.

I created a similar module for one of our costomers, this is how it works if you want to create your own module:

Depending on when you want to add the free product, use one of these events:

Add the product to the cart (user is able to remove the free product)

sales_quote_add_item if you want your product B to be automatically added to the cart if user adds product A.

You might also remove the free product B when product A is removed from cart, use sales_quote_remove_item for this.

Add the product to the quote/order

sales_convert_quote_to_order if you want your product B to be added automatically to the order after the user placed the order. The user will now automatically have product B as product in his order and will see the result in the order details.


This isn't native to Magento. So it's not that you can't find it, it's just not there already.

Free Gift with Purchase is what your looking for, and there are several extensions that handle it for you.

I haven't been working as close with our in-house developer, so I'm not able to answer 100% how it's done if you wanted to develop it yourself...

  • So I wonder, is there another way to rig such a promotion. Perhaps through a bundled product that allows the customer to choose a selection equaling the required number of products that gives the free product at a price of zero? (I may be way off here as I have limited experience with bundled products, just looking to make any configuration meet the above scenario)
    – Brandon
    Commented Jun 27, 2014 at 5:48

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.

  • Nice extension, thank you. We're having trouble with the extension not saving the free gift sku to the DB, any ideas? Thanks Commented May 13, 2017 at 12:49

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.