Jump to content

Custom notification in 1.7 backoffice on module error


Recommended Posts

Hello, I'm developing a module that adds a custom tab to the product sheet. The module performs some DB operations at product add/update; in PS 1.6 I could report any error using code like

$this->context->controller->errors[] = 'my message'

In 1.7 this does not work. Having a look on the forum I found a solution which is not what I'm looking for, which consists in adding

	header("HTTP/1.0 400 Bad Request");
 die(json_encode(array( 'error' => array($this->l(' Error') ))));
	

This code leads to a red pop-up appearing with the message that it was not possible to update the product. I would like instead to separate PS message from my module's, showing (for example) "Product was successfully updated" standard PS notification and my "Error: module error" custom notification.

 

Is there any way to perform this operation?

Edited by Uff182 (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...