开发者

Magento - cart page blank caused by the following function (crashing app)

Anyone have any ideas... there's like 15 places this function is getting called, every time it hits it seems to be the problem, it gets through the function but the serialized length of :

echo "Length serialized: " . strlen(serialize($this->_items));

comes out to be about 8000 long.

 public function getItemsCollection($useCache = true)
    {
      if (is_null($this->_items)) {
            $this->_items = Mage::getModel('sales/quote_item')->getCollection()
                            ->addFieldToFilter("quote_id", $this->getId())开发者_JAVA技巧
            ;
           #$this->_items->setQuote($this);
        } 
        echo "Length serialized: " . strlen(serialize($this->_items));
        exit;


       return $this->_items;

    } 


Seems to me like there is something weird in the item object. Like one of its members has a large object tied to it. I know that I had issues saving addresses to a session object. Maybe there is something you are doing outside of this that is attaching a large object that errors out. You could do the following to get the raw sql and run it on your database to see what comes back

public function getItemsCollection($useCache = true)
    {
      if (is_null($this->_items)) {
            $this->_items = Mage::getModel('sales/quote_item')->getCollection()
                            ->addFieldToFilter("quote_id", $this->getId())
            ;
           #$this->_items->setQuote($this);
        } 
        echo (String)Mage::getModel('sales/quote_item')->getCollection()->getSelect();
        exit;


       return $this->_items;

    } 


i had same issues when i coded with Magento, it's linked to recursion, try var_dump() instead of echo()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜