# Subtotal with Discount in Shopping Cart Price Rule

I'm trying to do something that I'm not sure is possible in Magento, at least it's not working for me currently anyway.

We have a customer who receives a variable rate of discount on all products based on how much they spend PER ORDER. For example, if they spend more than £100 - they get 25% off. If they spend £150 they get 30% off, if they spend £200 they get 35%.

In isolation this works fine, using the "Subtotal" condition. Where it stops working is when other rules that can also apply are factored in.

We have a product that has a "Buy X get Y free (discount amount is Y)" rule on it - to give customers who buy 3 of the product the third product free. This means if they buy product A for £30 each (£90 subtotal), they get a discount of £30..

The problem I'm having:

Scenario 1 (good):

1. Customer has £75 of product to their basket
2. Customer not entitled to discount (<£100)
3. Customer has £125 of product to their basket 4. Customer entitled to 25% discount (>=£100 and <£150)

1. Customer has 5 of product A (£30 each) in basket, equalling £150 subtotal
2. Customer receives discount of £30 (3 for 2 rule)
3. Magento gives customer 30% discount, because it thinks they are over £150 threshold, but in reality they are under due to other rules.

I tried to solve this by implementing a "Subtotal after Discount" condition using code from this page: https://stackoverflow.com/a/16808826 - but this just results in the rule factoring ITS OWN DISCOUNT into the rule!

Is this possible in Magento (CE 1.7.0.2)?

I think you can achieve this by setting priorities to your rules.
So your 30% discount rule should be processed last.
This way it will take into consideration the subtotal with the discount from other applied rules.
So set for this rule an outrageous priority number to be sure nothing is processed after it.
Something like 99999.

• If i apply shopping cart price rule, it will be applied on subtotal how to make it rule apply only on a product not subtotal?
– Gem
Oct 11, 2018 at 6:47