We facing same issue when we add to cart configurable product. but i didn’t get any solution, after one month i will debug the code. and I found the issue with sales rule with a subselection of categories.
In: Mage_SalesRule_Model_Rule_Condition_Product_Combine::validate(), there is call to check the child products if the product in play is configurable; if invalid, it will check the children:
$valid = $children && $this->validate($children[0]);
The problem is that $this refers to Mage_SalesRule_Model_Rule_Condition_Product_Subselect. Notice in the validate method within this class, we have:
foreach ($object->getQuote()->getAllVisibleItems() as $item) {
if (parent::validate($item)) {
$total += $item->getData($attr);
}
}
Well, that’s a problem! The Visible Quote Items will be retrieved over and over and the parent method will continue to call the configurable item. This Mage_SalesRule_Model_Rule_Condition_Product_Subselect::validate will never run on the child object so we have an infinite loop and nobody will be able to add or view the cart.
To fix, I changed:
$valid = $children && $this->validate($children[0]);
to
$valid = $children && self::validate($children[0]);
File location: app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php
This allows the Mage_SalesRule_Model_Rule_Condition_Product_Combine::validate method to run on the child products, as it should.
Update 11/21/2014
Magento just provided a patch for this as PATCH_SUPEE-4814_EE_1.14.1.0_v1.sh
Changes are in: app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php on line 114:
From: if (parent::validate($item)) {
To: if (Mage_Rule_Model_Condition_Combine::validate($item)) {
Ref URL: http://magento.stackexchange.com/questions/37395/magento-debug-trace
Ref URL: http://magento.stackexchange.com/questions/53699/fatal-error-when-adding-configurable-product-in-cart-and-using-products-subsele