First four free - changing product pricing based on cart quantity in Commerce using Rules Brief:


Product with SKU "sample" has a unit price of £0.00
Once quantity > 4, product unit price is £2.50
First four remain free. E.g if five in cart = (4 x £0.00) + (1 x £2.50).


Currently I have the first two requirements working, I can change the price of a particular product once there are more than 4 items, my current problem is that because the unit price changes, it counts for the four "free". So currently 5 samples bill at £12.50, instead of £2.50.

You can see my rules set up here:


The easiest solution would be to apply a discount of £10.00 to the cart, but I can only see options to alter a unit price of a line item, rather than applying a discount to the order.

How should I do this?

Possible solution avenue

I added a second action "Add line item to cart" and created a product with value of -£10.00. The problem here is that when the quantity is reduced to 4 or below, the line item remains. I cannot see a rule option to then remove that line item.
You can add a custom rules condition for line item which will check next:


if the amount of items in cart is more than 4 
if the current line item position is greater that 4 (load cart, sort cart line items by created date)


Use the custom condition in pricing rules for line item.