Shwamateur Posted July 9, 2014 Share Posted July 9, 2014 Hi everyone, im struggling with this problem: I want to display a warning or an error message (whichever is easier to do) from a module. More concretely i'm trying to achieve this from a module. The goal is that a message like this is shown: whenever any user updates a product and he or she doesn't select a supplier for the product. I'm trying to trigger this from the hook "hookupdateproduct". Can anyone help me, please? Thank you in advance. Link to comment Share on other sites More sharing options...
Shwamateur Posted July 10, 2014 Author Share Posted July 10, 2014 Anyone? I thought this shouldn't be so difficult.... Link to comment Share on other sites More sharing options...
El Patron Posted July 10, 2014 Share Posted July 10, 2014 you are light on details, does your module have a form that is interacting with the shop owner? if so then when they save or do some other action then display the message in the form. Link to comment Share on other sites More sharing options...
Appwards Posted May 18, 2015 Share Posted May 18, 2015 I have this same question, but I'll add some more info as the OP seems to have left the thread. I'm using PS1.6 and I've created a module that adds a new product tab to the back office. This works just fine, but I want to throw an error when someone forgets to fill out a specific field. Inside of my module, during actionProductSave, actionProductUpdate and actionObjectProductUpdateAfter I've added $this->displayError('Oh dear!'); and made the method return false, but that didn't help. Neither did $this->errors[] = Tools::displayError('Oh dear'); Any ideas? Link to comment Share on other sites More sharing options...
Appwards Posted May 19, 2015 Share Posted May 19, 2015 Ha! That did the trick. I guess I need to learn a bit more about that context object. Thanks a lot! Link to comment Share on other sites More sharing options...
hakeryk2 Posted January 5, 2018 Share Posted January 5, 2018 (edited) On 19.05.2015 at 9:29 AM, Appwards said: Ha! That did the trick. I guess I need to learn a bit more about that context object. Thanks a lot! What did the trick? There is no previous message. Anyway, the way to achieve what OP was asking for is $this->adminDisplayWarning('Your message'); Edited January 8, 2018 by hakeryk2 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now