1

When I try to get cart items by using getQuote() method like

Mage::getModel('checkout/cart')->getQuote();

It generates new quote id on every time of this line call. sales_flat_quote table growing rapidly and it will make a looping! And show the below error! Please check the screenshot!

Fatal error: Maximum function nesting level of '6000' reached, aborting!

enter image description here

This issue occurs only some times and for some customers only. If I check in another system, Its showing fine! It rectify automatically after some times. But I can't understand why it happening.

Any advice or suggestions would be greatly appreciated!

EDIT

I have created custom module for add handling fee amount. I just wrote a code like get cart items quantity of specific category, and add fee amount based on this quantity. I have followed this tutorial. I'm just using Mage::getModel('checkout/cart')->getQuote(); for get cart items.

 public function getitemqtys() { 
        $request = Mage::getModel('checkout/cart')->getQuote();
        foreach ($request->getAllItems() as $item) {
            $product = Mage::getModel('catalog/product');
            $product->setId($item->getProductId());
            $cat_ids = $product->getResource()->getCategoryIds($product);       
            if (in_array(1057, $cat_ids)){
                $item_quanties+=$item->getQty();
            }
        }
        return  $item_quanties;
     }

Tried this code for get Cart item quantities of specific category!

  • This issue may raise due to any third module.you need to check that module – Amit Bera Apr 25 '16 at 6:41
  • 1
    try Mage::getSingleton('checkout/cart')->getQuote(); – Codrain Technolabs Pvt Ltd Apr 25 '16 at 6:42
  • okay.. Thank you for your response. Let me check it. – DRAJI Apr 25 '16 at 6:44
  • @DRAJI : Have you get any solution ? – zed Blackbeard Apr 6 '18 at 7:52
2

I would assume the Gmi_Fee module is making bad things. Just a guess. Turn it off, monitor the logs whether it occurs again

  • I have created this module for add handling fee amount. I just wrote a code like get cart items quantity of specific category, and add fee amount based on this quantity. I have followed this tutorial. I'm just using Mage::getModel('checkout/cart')->getQuote(); for get cart items. I have updated that code in question. Am i doing anything wrong here? – DRAJI Apr 25 '16 at 7:06
0

TL;DR: Disabled XDebug and you will be fine.

This error message comes specifically from the XDebug extension. PHP itself does not have a function nesting limit. Change the setting in your php.ini:

xdebug.max_nesting_level = 10000

or in your PHP code:

ini_set('xdebug.max_nesting_level', 10000);

As for if you really need to change it (i.e.: if there's a alternative solution to a recursive function), I can't tell without the code.

  • HI, Thank you for your response. In before, we have 2000 for max_nesting_level value. Due to this issue, we have increased that nesting level into 6000. I think, it only may not an issue. I have updated the question. – DRAJI Apr 25 '16 at 7:47
  • 2
    This solves only the problem if you DON'T have an endless loop. – Fabian Blechschmidt Apr 25 '16 at 10:10

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.