8

How to implement and apply Buy X And Get Y another product of same category free in the shopping cart price rules in magento.

  • I have tried to implement it by adding own code but that was not correct by logic somewhat then I have tried to add an extension from the website link but that too has limitation that we have to manually everytime add the rule for each product on whom we want to apply this offer.we can not directly apply the rule for the whole category in one attempt. – Bhavesh Tilvani Mar 4 '14 at 5:30
  • for assigning category follow, shaileshprajapati.com/magento/buy-x-get-y-free-magento – Helphin Mar 4 '14 at 12:17
  • i implemented according to the last post for applying the rule on whole category but it does not work if i buy 1(X product) product of same category and another 1 product of same category(y product) .so help me regarding this problem..... – Bhavesh Tilvani Mar 5 '14 at 5:17
  • Any body looking for Magento 2.1 solution plz chk it here magento.stackexchange.com/questions/209030/… – Ishak Ali Jan 24 '18 at 9:01
  • Anbody looking for Magento 2 please check answer here magento.stackexchange.com/questions/209030/… – Ishak Ali Dec 19 '18 at 7:26
9

There is no "Buy X get Y" rule for different X and Y in the Magento default package. The rule we have can only discount some qty of the SAME products. Like if we get 10 t-shirts we can receive 11-th for free. But there is NO WAY to receive a belt instead of t-shirt.

The options are either create a custom module or select some ready to use from the magento connect.

If you want to create your own, here some tips based on "Special Promotions" plugin:

  1. add a new field to be able to set "X" condition
  2. listen for salesrule_validator_process event and check if the current item is X
  3. if it is X then loop through $address->getAllItems() and find Y, set discount
  • 1
    We tried the Special Promotions Pro from Amasty and it really works well for our needs and for this kind of instances. Thank you for the suggestion. – Ner Nov 20 '17 at 12:49
2

I was able to simulate the desired behaviour by doing this: (For buy 3 of product X, get 1 product Y free)

Conditions: - Total quantity of SKU X is greater or equal to 3

Actions: - Apply: Discount (percentage of product price) - Percentage = 100 - Maximum Qty Discount is Applied To: 1 - Apply rule to has condition: SKU = Y

This would work for buy 2 X, get Y free

Unfortunately it does not work for 6 items, get 2 free. That could be done by an extra rule though with a higher prio that checks for 6 / 2

Edit: This does not work when you have variants of SKU Y. If customer buys 3 X and 2 variants of Y, he gets both of Y for free.

To remedy the last problem, I changed the rule to give a fixed amount (product Y price) on the whole shopping cart. That worked OK for us.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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