In Mage_SalesRule_Model_Validator::process()
, it checks whether or not the available shopping cart rules apply to items in the shopping cart via $this->_canProcessRule($rule, $address))
.
_canProcessRule()
in turn checks $rule->hasIsValidForAddress($address)
(Mage_SalesRule_Model_Rule
), which returns false
for a particular item I have in my cart, and the shopping cart rule does not apply. The item I have is a simple product that is added from a grouped product page. The simple product is not visible. $rule->hasIsValidForAddress($address)
returns true
if this simple product is added to cart from an associated with a configurable product.
UPDATE:
The shopping cart price rule I have is simple. Take $1 off from the cart if any of the product in the cart is in category X
. The grouped item is visible in Catalog,Search
and the associated simple products are Not Visible
.
I later realized that shopping cart rules do not apply to Not Visible
products, which in my case as the simple products that don't need to be visible since they're associated with a grouped product (configurable-simple products behave differently when being purchased). I made a separate post regarding this HERE.
So, why is this checking I'm still not clear why this simple product does not have a validated address.$address
(Mage_Sales_Model_Quote_Address
)?