Consider the following snippet from my populated Magento CE 1.9.0.1 cart:
I have two test cart rules in play here:
- "50 Bucks Texas", Priority 1, discounts the cart by 50.00 if the customer has selected Texas as their region.
- "Over 100.00 get 10.00 off", Priority 9999, discounts the cart by 10.00 if the subtotal is greater than 100.00
As you can see both rules are coming up valid and are being applied even though after Rule #1 the subtotal (with discount) is less than 100.00. The desired action would be that Rule #2 does not validate because with Rule #1 in play the customer would be spending less than 100.00.
I have fought this issue in a number of ways to no avail. If it can be solved through rule configuration or other configuration I haven't been able to figure out what that is.
If it can be solved by modifying code can someone point me in the right direction? One thing I tried as a proof-of-concept was to add a new attribute option of "Base Subtotal with Discount" to the Cart Attributes by modifying:
/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php
class Mage_SalesRule_Model_Rule_Condition_Address extends Mage_Rule_Model_Condition_Abstract
{
public function loadAttributeOptions()
{
$attributes = array(
'base_subtotal_with_discount' => 'Subtotal with Discount',
'base_subtotal' => Mage::helper('salesrule')->__('Subtotal'),
'total_qty' => Mage::helper('salesrule')->__('Total Items Quantity'),
'weight' => Mage::helper('salesrule')->__('Total Weight'),
Here I blindly added the first attribute key in that array "base_subtotal_with_discount" simply based on finding that string elsewhere in the code alongside the string 'base_subtotal'. I was hoping I would get lucky and that would resolve to what I needed but unfortunately it does not. I haven't been able to figure out where upstream I would define "base_subtotal_with_discount" so that I can use it.