I've been playing around with the Shopping Cart Price Rules for Magento Enterprise 1.14.1.0 and have stumbled across a problem.
I was trying to create a simple rule such that you would get a £10 discount if you buy any 3 items from a defined category, and have spent more than £15. See my configuration below.
In my basket I have 3 items from the category with id 5
, and 1 item from the category with id 3
.
When I enable this rule and view my basket, I receive the fatal error. Here's a section of the stack trace. As you can see I've already bumped up the xdebug.max_nesting_level
to horrifying levels.
Fatal error: Maximum function nesting level of '18000' reached, aborting! in /dev/builds/1_14_1_0/lib/Varien/Object.php on line 344 Call Stack:
0.0003 348680 1. {main}() /dev/builds/1_14_1_0/index.php:0
0.0020 694956 2.Mage::run() /dev/builds/1_14_1_0/index.php:89
0.0068 1819640 3.Mage_Core_Model_App->run() /dev/builds/1_14_1_0/app/Mage.php:684
0.0509 9129168 4.Mage_Core_Controller_Varien_Front->dispatch() /dev/builds/1_14_1_0/app/code/core/Mage/Core/Model/App.php:354
0.0626 11074424 5. Mage_Core_Controller_Varien_Router_Standard->match() /dev/builds/1_14_1_0/app/code/core/Mage/Core/Controller/Varien/Front.php:172
0.0658 11765288 6. Mage_Core_Controller_Varien_Action->dispatch() /dev/builds/1_14_1_0/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:250
0.1314 16963044 7. Mage_Checkout_CartController->indexAction() /dev/builds/1_14_1_0/app/code/core/Mage/Core/Controller/Varien/Action.php:418
0.3065 27313592 8. Mage_Checkout_Model_Cart->save() /dev/builds/1_14_1_0/app/code/core/Mage/Checkout/controllers/CartController.php:144
0.3195 28006864 9. Mage_Sales_Model_Quote->collectTotals() /dev/builds/1_14_1_0/app/code/core/Mage/Checkout/Model/Cart.php:458
0.3827 32507432 10. Mage_Sales_Model_Quote_Address->collectTotals() /dev/builds/1_14_1_0/app/code/core/Mage/Sales/Model/Quote.php:1331
0.6151 37466752 11. Mage_SalesRule_Model_Quote_Freeshipping->collect() /dev/builds/1_14_1_0/app/code/core/Mage/Sales/Model/Quote/Address.php:1013
0.6245 37839108 12. Mage_SalesRule_Model_Validator->processFreeShipping() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php:74
0.6247 37839784 13. Mage_SalesRule_Model_Validator->_canProcessRule() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Validator.php:249
0.6282 37960924 14. Mage_Rule_Model_Abstract->validate() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Validator.php:223
0.6418 38895940 15. Mage_Rule_Model_Condition_Combine->validate() /dev/builds/1_14_1_0/app/code/core/Mage/Rule/Model/Abstract.php:353
0.6420 38896372 16. Mage_SalesRule_Model_Rule_Condition_Product_Subselect->validate() /dev/builds/1_14_1_0/app/code/core/Mage/Rule/Model/Condition/Combine.php:307
0.6421 38896772 17. Mage_SalesRule_Model_Rule_Condition_Product_Combine->validate() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php:117
0.6428 38898084 18. Mage_SalesRule_Model_Rule_Condition_Product_Subselect->validate() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php:219
0.6429 38898484 19. Mage_SalesRule_Model_Rule_Condition_Product_Combine->validate() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php:117
0.6433 38898572 20. Mage_SalesRule_Model_Rule_Condition_Product_Subselect->validate() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php:219
0.6434 38898972 21. Mage_SalesRule_Model_Rule_Condition_Product_Combine->validate() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php:117
0.6439 38899060 22. Mage_SalesRule_Model_Rule_Condition_Product_Subselect->validate() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php:219
0.6440 38899460 23. Mage_SalesRule_Model_Rule_Condition_Product_Combine->validate() /dev/builds/1_14_1_0/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php:117
When I remove the If total quantity is 3
section from the Condition
then Magento no longer freaks out. Could someone point me in the correct way to configure this promotion, as well as shed some light on why I'm fataling?
This is a vanilla installation of Magento, and I'm concerned that I can break the shopping cart so easily.
Update
I am running mysql as
Server version: 5.5.41-0ubuntu0.12.04.1 (Ubuntu)
And PHP as
PHP 5.3.10-1ubuntu3.15 with Suhosin-Patch (cli) (built: Oct 29 2014 12:16:30)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
Update 2
A database dump is available here, comes in at ~130kb.
http://www.lukerodgers.co.uk/files/vanilla_1_14_1_0.sql.gz
- Was created with mysql running it as root @ localhost with no password
- Magento admin panel username is
admin
and the password ispassword1
- You'll need to update the
web/unsecure/base_url
andweb/secure/base_url
incore_config_data
to point to your install instance.
To replicate
- As guest, Add 1 Green Bowler to your basket
- Then Add 3 Green Boots to your basket
- Hopefully have a horrible error like I am seeing
magerun index:reindex:all
and it made no difference. I'm super busy today and tomorrow at work, but if you still fail to replicate I will be able to provide a DB dump on thursday if that's good? – Luke Rodgers Feb 24 '15 at 9:34