2

I am trying to update order summary block on payment method change but it display

Fatal error: Call to a member function toHtml() on boolean in C:\xampp\htdocs\young\app\code\local\Mage\Checkout\controllers\OnepageController.php on line 172

170 protected function _getReviewHtml()
171 {
172 return $this->getLayout()->getBlock('root')->toHtml();
173 }
public function orderupdateAction()
{
 if ($this->_expireAjax()) {
 return;
 }
 $result['goto_section'] = 'review';
 $result['update_section'] = array(
 'name' => 'review',
 'html' => $this->_getReviewHtml()
 );
 $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
}
dotancohen
1,1306 silver badges21 bronze badges
asked Nov 16, 2015 at 13:48
0

1 Answer 1

4

This will be an issue with the layout.xml and your custom controller action.

Magento cannot find the root block for your action and fatals when trying to call toHtml on it.

Adding the following to create an empty root block into your checkout.xml layout should allow you to not fatal.

<checkout_onepage_orderupdate>
 <block name="root" type="core/template"/>
</checkout_onepage_orderupdate>

(Obviously if you want _getReviewHtml to return something viable you will have to pop a valid block in the layout definition, as currently it will just return nothing)

answered Nov 16, 2015 at 14:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.