开发者

Fatal error: Call to a member function setTitle() on a non-object

When I try to pl开发者_如何转开发acing an order, while selecting the shipping method an error is getting saying

Fatal error: Call to a member function setTitle() on a non-object in /home/exclus31/public_html/../../../app/code/core/Mage/Customer/Block/Form/Login.php on line 40

But there is no problem for placing the order and got the confirmation message for the particular order.

Any one know why this error is shown and a solution for this?


I had this error as well. It was because I was calling getLayout() in my IndexAction() before I had loaded the layout. Just call loadLayout() first, like so:

public function IndexAction() {
  $this->loadLayout(); // do this first
  $this->getLayout()->getBlock('head')->setTitle($this->__('My Title')); // then this works
  $this->renderLayout(); // render as usual
}

I hope this helps

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜