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;
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
add a comment |
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
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
add a comment |
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
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
magento2 event-observer
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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