|
Please help I have cant get this to work.
I have a template file:
suburbs.phtml
<h1>Do we deliver to your suburb</h1> <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
I have a controller
class Grocer_Suburbs_IndexController extends Mage_Core_Controller_Front_Action { public function indexAction() { $session = $this->_getSession(); $this->_initLayoutMessages('core/session'); $session->addError($this->__('Well Done')); $this->loadLayout(); $this->renderLayout(); } protected function _getSession() { return Mage::getSingleton('core/session'); }
It shows the heading ‘Do we deliver to your suburb’ but no error, Why will it not show the error.
if i print_r($session) session there error is there
see here: (part of print_r())
Mage_Core_Model_Message_Collection Object ( [_messages:protected] => Array ( [error] => Array ( [0] => Mage_Core_Model_Message_Error Object ( [_type:protected] => error [_code:protected] => Well Done
|