Message in postdispatchRender Javascript on customer_login eventHow to add filtering to custom table field column in Customers admin grid in Magento2?System Error/Success messages are not displaying in custom themeMagento 2 Sending emails triggered by observerSince upgrade from Magento 2.1 to 2.2 I have localization erros on my moduleMagento 2: Add a product to the cart programmaticallyMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2: set cron job result programmaticallyMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.2.3 CE unable to add/remove item from wishlist?

Integer Lists of Noah

Are unclear "take-it or leave-it" contracts interpreted in my favor?

QGIS Zanzibar how to crop?

How can I effectively communicate to recruiters that a phone call is not possible?

Professor falsely accusing me of cheating in a class he does not teach, 2 months after end of the class. What precautions should I take?

Graduate student with abysmal English writing skills, how to help

How did the hit man miss?

Is "I do not want you to go nowhere" a case of "DOUBLE-NEGATIVES" as claimed by Grammarly?

Should disabled buttons give feedback when clicked?

Why weren't bootable game disks ever common on the IBM PC?

What is this triple-transistor arrangement called?

Why are Hobbits so fond of mushrooms?

Was I subtly told to resign?

Are neural networks prone to catastrophic forgetting?

Single word for "refusing to move to next activity unless present one is completed."

Why isn't there research to build a standard lunar, or Martian mobility platform?

How can I deal with a player trying to insert real-world mythology into my homebrew setting?

What steps should I take to lawfully visit the United States as a tourist immediately after visiting on a B-1 visa?

Is there any word for "disobedience to God"?

Does throwing a penny at a train stop the train?

What explains 9 speed cassettes price differences?

Combining latex input and sed

Would dual wielding daggers be a viable choice for a covert bodyguard?

How do you glue a text to a point?



Message in postdispatch


Render Javascript on customer_login eventHow to add filtering to custom table field column in Customers admin grid in Magento2?System Error/Success messages are not displaying in custom themeMagento 2 Sending emails triggered by observerSince upgrade from Magento 2.1 to 2.2 I have localization erros on my moduleMagento 2: Add a product to the cart programmaticallyMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2: set cron job result programmaticallyMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.2.3 CE unable to add/remove item from wishlist?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















Can't make messages to appear on frontend. I have an observer on event:



<event name="controller_action_postdispatch_cms">
<observer name="some_module_controller_action_postdispatch" instance="SomeModuleObserverPostdispatchFrontendActionControllerObserver" />
</event>


SomeModuleObserverPostdispatchFrontendActionControllerObserver execute() method looks something like this:



 public function execute(MagentoFrameworkEventObserver $observer)

$this->messageManager->addSuccess(
__('success message')
);

return $this;



I can't see any messages on frontend. why is that?










share|improve this question
























  • In the title you say "Message in predispatch" and then you observe _postdispatch. Is it intentional?

    – fmrng
    Feb 1 '16 at 15:39











  • my bad, sorry. Its about postdispatch

    – ciemin
    Feb 1 '16 at 16:01

















2















Can't make messages to appear on frontend. I have an observer on event:



<event name="controller_action_postdispatch_cms">
<observer name="some_module_controller_action_postdispatch" instance="SomeModuleObserverPostdispatchFrontendActionControllerObserver" />
</event>


SomeModuleObserverPostdispatchFrontendActionControllerObserver execute() method looks something like this:



 public function execute(MagentoFrameworkEventObserver $observer)

$this->messageManager->addSuccess(
__('success message')
);

return $this;



I can't see any messages on frontend. why is that?










share|improve this question
























  • In the title you say "Message in predispatch" and then you observe _postdispatch. Is it intentional?

    – fmrng
    Feb 1 '16 at 15:39











  • my bad, sorry. Its about postdispatch

    – ciemin
    Feb 1 '16 at 16:01













2












2








2








Can't make messages to appear on frontend. I have an observer on event:



<event name="controller_action_postdispatch_cms">
<observer name="some_module_controller_action_postdispatch" instance="SomeModuleObserverPostdispatchFrontendActionControllerObserver" />
</event>


SomeModuleObserverPostdispatchFrontendActionControllerObserver execute() method looks something like this:



 public function execute(MagentoFrameworkEventObserver $observer)

$this->messageManager->addSuccess(
__('success message')
);

return $this;



I can't see any messages on frontend. why is that?










share|improve this question
















Can't make messages to appear on frontend. I have an observer on event:



<event name="controller_action_postdispatch_cms">
<observer name="some_module_controller_action_postdispatch" instance="SomeModuleObserverPostdispatchFrontendActionControllerObserver" />
</event>


SomeModuleObserverPostdispatchFrontendActionControllerObserver execute() method looks something like this:



 public function execute(MagentoFrameworkEventObserver $observer)

$this->messageManager->addSuccess(
__('success message')
);

return $this;



I can't see any messages on frontend. why is that?







magento2 event-observer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 1 '16 at 16:01







ciemin

















asked Feb 1 '16 at 14:46









cieminciemin

1201 gold badge2 silver badges9 bronze badges




1201 gold badge2 silver badges9 bronze badges












  • In the title you say "Message in predispatch" and then you observe _postdispatch. Is it intentional?

    – fmrng
    Feb 1 '16 at 15:39











  • my bad, sorry. Its about postdispatch

    – ciemin
    Feb 1 '16 at 16:01

















  • In the title you say "Message in predispatch" and then you observe _postdispatch. Is it intentional?

    – fmrng
    Feb 1 '16 at 15:39











  • my bad, sorry. Its about postdispatch

    – ciemin
    Feb 1 '16 at 16:01
















In the title you say "Message in predispatch" and then you observe _postdispatch. Is it intentional?

– fmrng
Feb 1 '16 at 15:39





In the title you say "Message in predispatch" and then you observe _postdispatch. Is it intentional?

– fmrng
Feb 1 '16 at 15:39













my bad, sorry. Its about postdispatch

– ciemin
Feb 1 '16 at 16:01





my bad, sorry. Its about postdispatch

– ciemin
Feb 1 '16 at 16:01










1 Answer
1






active

oldest

votes


















0














Try to add messages to your block:



protected function _prepareLayout()

$this->addMessages($this->messageManager->getMessages(true));
parent::_prepareLayout();



then add your block to layout:



 <referenceContainer name="page.messages">
<block class="MagentoCheckoutBlockCartValidationMessages" name="checkout.cart.validationmessages"/>
</referenceContainer>


Look how it is implemented in Magento modules:
https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/Block/Cart/ValidationMessages.php



https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml






share|improve this answer























  • All I want to do it to create an observer on <event name="controller_action_postdispatch"> In the observer I want to add system message (success or error). The massage need to be shown on cms/index/index page or any product page. the message block is already there! The message doesnt show. Messages stack and are shown f.e. when I add a product to a cart. Then I can see spam of my messages.

    – ciemin
    Feb 2 '16 at 7:49














Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f99889%2fmessage-in-postdispatch%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Try to add messages to your block:



protected function _prepareLayout()

$this->addMessages($this->messageManager->getMessages(true));
parent::_prepareLayout();



then add your block to layout:



 <referenceContainer name="page.messages">
<block class="MagentoCheckoutBlockCartValidationMessages" name="checkout.cart.validationmessages"/>
</referenceContainer>


Look how it is implemented in Magento modules:
https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/Block/Cart/ValidationMessages.php



https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml






share|improve this answer























  • All I want to do it to create an observer on <event name="controller_action_postdispatch"> In the observer I want to add system message (success or error). The massage need to be shown on cms/index/index page or any product page. the message block is already there! The message doesnt show. Messages stack and are shown f.e. when I add a product to a cart. Then I can see spam of my messages.

    – ciemin
    Feb 2 '16 at 7:49
















0














Try to add messages to your block:



protected function _prepareLayout()

$this->addMessages($this->messageManager->getMessages(true));
parent::_prepareLayout();



then add your block to layout:



 <referenceContainer name="page.messages">
<block class="MagentoCheckoutBlockCartValidationMessages" name="checkout.cart.validationmessages"/>
</referenceContainer>


Look how it is implemented in Magento modules:
https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/Block/Cart/ValidationMessages.php



https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml






share|improve this answer























  • All I want to do it to create an observer on <event name="controller_action_postdispatch"> In the observer I want to add system message (success or error). The massage need to be shown on cms/index/index page or any product page. the message block is already there! The message doesnt show. Messages stack and are shown f.e. when I add a product to a cart. Then I can see spam of my messages.

    – ciemin
    Feb 2 '16 at 7:49














0












0








0







Try to add messages to your block:



protected function _prepareLayout()

$this->addMessages($this->messageManager->getMessages(true));
parent::_prepareLayout();



then add your block to layout:



 <referenceContainer name="page.messages">
<block class="MagentoCheckoutBlockCartValidationMessages" name="checkout.cart.validationmessages"/>
</referenceContainer>


Look how it is implemented in Magento modules:
https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/Block/Cart/ValidationMessages.php



https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml






share|improve this answer













Try to add messages to your block:



protected function _prepareLayout()

$this->addMessages($this->messageManager->getMessages(true));
parent::_prepareLayout();



then add your block to layout:



 <referenceContainer name="page.messages">
<block class="MagentoCheckoutBlockCartValidationMessages" name="checkout.cart.validationmessages"/>
</referenceContainer>


Look how it is implemented in Magento modules:
https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/Block/Cart/ValidationMessages.php



https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 1 '16 at 16:32









Arkadii ChyzhovArkadii Chyzhov

2,4887 silver badges14 bronze badges




2,4887 silver badges14 bronze badges












  • All I want to do it to create an observer on <event name="controller_action_postdispatch"> In the observer I want to add system message (success or error). The massage need to be shown on cms/index/index page or any product page. the message block is already there! The message doesnt show. Messages stack and are shown f.e. when I add a product to a cart. Then I can see spam of my messages.

    – ciemin
    Feb 2 '16 at 7:49


















  • All I want to do it to create an observer on <event name="controller_action_postdispatch"> In the observer I want to add system message (success or error). The massage need to be shown on cms/index/index page or any product page. the message block is already there! The message doesnt show. Messages stack and are shown f.e. when I add a product to a cart. Then I can see spam of my messages.

    – ciemin
    Feb 2 '16 at 7:49

















All I want to do it to create an observer on <event name="controller_action_postdispatch"> In the observer I want to add system message (success or error). The massage need to be shown on cms/index/index page or any product page. the message block is already there! The message doesnt show. Messages stack and are shown f.e. when I add a product to a cart. Then I can see spam of my messages.

– ciemin
Feb 2 '16 at 7:49






All I want to do it to create an observer on <event name="controller_action_postdispatch"> In the observer I want to add system message (success or error). The massage need to be shown on cms/index/index page or any product page. the message block is already there! The message doesnt show. Messages stack and are shown f.e. when I add a product to a cart. Then I can see spam of my messages.

– ciemin
Feb 2 '16 at 7:49


















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f99889%2fmessage-in-postdispatch%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?