Reading list Switch to dark mode

    Showing custom message in prestashop 1.5

    Updated 2 April 2013

    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()

    Searching for an experienced
    Prestashop Company ?
    Find out More

    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).');

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home