<p>I've used a relatively simple plugin to listen to <code>commerce_cart.onBeforeAddToCart</code>which checks what is being added to a cart and if it is a certain item it will automatically add the free item to the cart (or increment the qty if it's already in there).</p>

<p>(Of course you must then also listen to <code>commerce_cart.onRemoveFromCart</code> to remove the free item if the 'parent' item is removed...as I recall this is slightly trickier as you get a copy of the order with the item removed (there's no <code>beforeRemoveFromCart</code> yet) - so you jsut have to loop over the whole cart and look at it holistically).</p>

<p><a href="https://craftcommerce.com/docs/events-reference#commerce_cart.onbeforeaddtocart" rel="noreferrer">https://craftcommerce.com/docs/events-reference#commerce_cart.onbeforeaddtocart</a> 
<a href="https://craftcommerce.com/docs/events-reference#commerce_cart.onremovefromcart" rel="noreferrer">https://craftcommerce.com/docs/events-reference#commerce_cart.onremovefromcart</a></p>

<p>(In general a business logic plugin can implement most discount things fairly easily but I am hoping a really nice, flexible GUI driven discounts plugin thingy comes along for Commerce!).</p>

CC BY-SA 3.0
2016-12-08T15:53:01.733Z
Thanks for the answer. I ended up making a plugin using the Adjusters api instead, plugin can be found here for anyone else interested: https://craftpl.us/plugins/product-deals
Stephen Hamilton
CC BY-SA 4.0
2019-06-03T08:07:52.183Z
@StephenHamilton Is this plugin available on Github anywhere? As Craft Plus seems to be dead :( RIP.
Jason Mayo
CC BY-SA 4.0
2019-06-03T13:11:03.300Z
@JasonMayo Here you go: https://github.com/totov/deals
Stephen Hamilton
CC BY-SA 4.0
2019-06-11T09:21:38.187Z
@StephenHamilton Amazing! Thanks for putting it on Github :)
Jason Mayo
CC BY-SA 3.0
2016-11-23T22:53:22.587Z
2016-11-23T22:53:22.587Z
Jeremy Daalder
<p>Under Commerce > Promotions there are the two options: Sales &amp; Discounts. Sales is a flat rate with little conditions, so that leaves Discounts.</p>

<p>Discounts have a bit more flexibility, but only seem to have a minimum quantity option. So, if I want to make a buy one get one free deal, I can't limit it to the quantity to a maximum of 2, therefore the discount gets applied to the total amount regardless of how many are added.</p>

<p>Has anyone else had any success setting up a BOGOF deal or anything similar?</p>

<plugins><plugin-craftcommerce>
How can I set a BOGOF (Buy One, Get One Free) promotion using Craft Commerce?
# How can I set a BOGOF (Buy One, Get One Free) promotion using Craft Commerce?

(Asked by: username_0 on 2016-08-25)

Under Commerce > Promotions there are the two options: Sales & Discounts. Sales is a flat rate with little conditions, so that leaves Discounts.

Discounts have a bit more flexibility, but only seem to have a minimum quantity option. So, if I want to make a buy one get one free deal, I can't limit it to the quantity to a maximum of 2, therefore the discount gets applied to the total amount regardless of how many are added.

Has anyone else had any success setting up a BOGOF deal or anything similar?

**Tags:** plugins, plugin-craftcommerce

---

## 1 answers

### Answer by username_1 on 2016-11-23. Score: 5

I've used a relatively simple plugin to listen to `commerce_cart.onBeforeAddToCart`which checks what is being added to a cart and if it is a certain item it will automatically add the free item to the cart (or increment the qty if it's already in there).

(Of course you must then also listen to `commerce_cart.onRemoveFromCart` to remove the free item if the 'parent' item is removed...as I recall this is slightly trickier as you get a copy of the order with the item removed (there's no `beforeRemoveFromCart` yet) - so you jsut have to loop over the whole cart and look at it holistically).

<https://craftcommerce.com/docs/events-reference#commerce_cart.onbeforeaddtocart>
<https://craftcommerce.com/docs/events-reference#commerce_cart.onremovefromcart>

(In general a business logic plugin can implement most discount things fairly easily but I am hoping a really nice, flexible GUI driven discounts plugin thingy comes along for Commerce!).

> **Comments:**
> **username_0**: Thanks for the answer. I ended up making a plugin using the Adjusters api instead, plugin can be found here for anyone else interested: https://craftpl.us/plugins/product-deals  
> **username_2**: @StephenHamilton Is this plugin available on Github anywhere? As Craft Plus seems to be dead :( RIP.  
> **username_0**: @JasonMayo Here you go: https://github.com/totov/deals  
> **username_2**: @StephenHamilton Amazing! Thanks for putting it on Github :)  

---

