Showing custom message in prestashop 1.5

Prestashop provide many way to show custom message . Some of the message which we generally see

1. “update successfully”
2. “Deletion successful”

etc. the upper message you got in classes/controller/AdminController.php.
under the variable $this->_conf.

we can add our own custom message in $this->_conf variable

this has been call in your public function __construct()

after calling parent

parent::__construct();
$index=count($this->_conf)+1;
$this->_conf[$index]=$this->l('Your Message');

and simply redirect by

Tools::redirectAdmin(self::$currentIndex.'&conf='.$index.'&token='.$this->token);

this help to show your custom message when any operation is successfully executed.

you can also show your message by using some predefined tag

$this->displayInformation($this->l('You have now three default customer groups.'));

$this->displayWarning($this->l('When you delete a
 language, all related translations in the database 
will be deleted.'));

$this->errors[] = Tools::displayError('An error occurred during 
image deletion (cannot load object).');
. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close