2

Item at http://wenderella.com/castaging/index.php/fruit-basket.html

It is a bundle product, a fruit basket, with dynamic pricing. Each fruit is a simple product with no stock management.

Option 1 (Required): Add a fruit - watermelon, pineapple or honeydew - Dropdown input, you can select qty of fruits you want

Option 2 (Not Required): Add another fruit - watermelon, pineapple or honeydew - Dropdown input, you can select qty of fruits you want

When I just add Option 1 or Option 2 to cart, there's no problem, it goes through.

But if I select something in both options (e.g. I choose a watermelon in option 1, then a pineapple in option 2), the following error occurs:

Fatal error: Nesting level too deep - recursive dependency? in /home/blacklea/public_html/wenderella.com/castaging/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php on line 134

I followed all steps to create a bundle product exactly (or so I think). What am I doing wrongly??

I have tried disabling all extensions and the error remains.

Version: CE 1.9.3

5

Modify app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php as stated below – only difference is , true being added to in_array() – and see if the exception disappears:

public function setParentItem($parentItem)
{
    if ($parentItem) {
        $this->_parentItem = $parentItem;
        // Prevent duplication of children in those are already set
        if (!in_array($this, $parentItem->getChildren(), true)) {
            $parentItem->addChild($this);
        }
    }
    return $this;
}

NB: Bear in mind that you're overriding a core file so for a more permanent solution you should either override the (child) class via a custom module or at least copy the vanilla file to app/code/local/Mage/Sales/Model/Quote/Item/Abstract.php and modify that one.

  • Hello, thanks for trying to help! I have done the above and updated the results in my question. Strangely, if it's of any significance, when I first added the code to Abstract.php, I managed to add 2 bundle items to the cart (error free). But that just happened once and the error happened again afterwards. – Wendy Nov 21 '16 at 2:30
  • Unfortunately, that doesn't help, you can remove the stack trace from your question as well as the code snippet from your method. Please see updated answer. – pong Nov 21 '16 at 10:06
  • That worked! Fantastic! Thanks so much for your help!! – Wendy Nov 21 '16 at 12:34
  • Glad to help :) Please mark the answer as such and consider upvoting if it was of any use to you. – pong Nov 21 '16 at 14:01
  • BTW: which php version and os platform are you using? I'm asking since in my case it worked without the fix. – pong Nov 21 '16 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.