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

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form