Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

“Since the train was delayed for more than an hour, passengers were given a full refund.” – Why is there no article before “passengers”?

How is an IPA symbol that lacks a name (e.g. ɲ) called?

Why isn't everyone flabbergasted about Bran's "gift"?

Does GDPR cover the collection of data by websites that crawl the web and resell user data

Marquee sign letters

Recursive calls to a function - why is the address of the parameter passed to it lowering with each call?

Are bags of holding fireproof?

Protagonist's race is hidden - should I reveal it?

Raising a bilingual kid. When should we introduce the majority language?

Are there any AGPL-style licences that require source code modifications to be public?

Trying to enter the Fox's den

Import keychain to clean macOS install?

Unix AIX passing variable and arguments to expect and spawn

Why does my GNOME settings mention "Moto C Plus"?

Does Prince Arnaud cause someone holding the Princess to lose?

Is Vivien of the Wilds + Wilderness Reclimation a competitive combo?

Putting Ant-Man on house arrest

Is my guitar’s action too high?

Can a Wizard take the Magic Initiate feat and select spells from the Wizard list?

When does Bran Stark remember Jamie pushing him?

Do chord progressions usually move by fifths?

Coin Game with infinite paradox

/bin/ls sorts differently than just ls

Etymology of 見舞い



Magento 2 - Add success message with knockout



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page



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








2















I need add an errorMessage or successMessage on checkout/cart after an jquery validation. I tried require file 'Magento_Ui/js/model/messageList' for this but not have success.



My code:



define(
[
'jquery',
'Magento_Ui/js/model/messageList'
],
function ($, messageList)
$.ajax(
type: "GET",
url: /route/controller,
async: false,
success: function (res)
if (res.val)
messageList.addErrorMessage('message': messageError);


);

);









share|improve this question
















bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.





















    2















    I need add an errorMessage or successMessage on checkout/cart after an jquery validation. I tried require file 'Magento_Ui/js/model/messageList' for this but not have success.



    My code:



    define(
    [
    'jquery',
    'Magento_Ui/js/model/messageList'
    ],
    function ($, messageList)
    $.ajax(
    type: "GET",
    url: /route/controller,
    async: false,
    success: function (res)
    if (res.val)
    messageList.addErrorMessage('message': messageError);


    );

    );









    share|improve this question
















    bumped to the homepage by Community 2 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      2












      2








      2








      I need add an errorMessage or successMessage on checkout/cart after an jquery validation. I tried require file 'Magento_Ui/js/model/messageList' for this but not have success.



      My code:



      define(
      [
      'jquery',
      'Magento_Ui/js/model/messageList'
      ],
      function ($, messageList)
      $.ajax(
      type: "GET",
      url: /route/controller,
      async: false,
      success: function (res)
      if (res.val)
      messageList.addErrorMessage('message': messageError);


      );

      );









      share|improve this question
















      I need add an errorMessage or successMessage on checkout/cart after an jquery validation. I tried require file 'Magento_Ui/js/model/messageList' for this but not have success.



      My code:



      define(
      [
      'jquery',
      'Magento_Ui/js/model/messageList'
      ],
      function ($, messageList)
      $.ajax(
      type: "GET",
      url: /route/controller,
      async: false,
      success: function (res)
      if (res.val)
      messageList.addErrorMessage('message': messageError);


      );

      );






      magento2 magento-2.1 knockoutjs messages






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 5 '18 at 13:50









      7ochem

      5,86493770




      5,86493770










      asked Jan 16 '18 at 14:12









      Thales SanThales San

      112




      112





      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















          2 Answers
          2






          active

          oldest

          votes


















          0














          Add success message in your controller it will automatically display in your page.






          share|improve this answer






























            0














            I'm not sure if you already solved this or not, but here it goes anyway. While Rakesh might be right (a controller is the preferred way), it doesn't answer the question. I found the easiest way of doing this is through the customerData object:



            customerData.set('messages', 
            messages: [
            type: 'success',
            text: 'Hello World'
            ]
            );





            share|improve this answer























              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%2f209657%2fmagento-2-add-success-message-with-knockout%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Add success message in your controller it will automatically display in your page.






              share|improve this answer



























                0














                Add success message in your controller it will automatically display in your page.






                share|improve this answer

























                  0












                  0








                  0







                  Add success message in your controller it will automatically display in your page.






                  share|improve this answer













                  Add success message in your controller it will automatically display in your page.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 5 '18 at 15:15









                  Rakesh VarmaRakesh Varma

                  75218




                  75218























                      0














                      I'm not sure if you already solved this or not, but here it goes anyway. While Rakesh might be right (a controller is the preferred way), it doesn't answer the question. I found the easiest way of doing this is through the customerData object:



                      customerData.set('messages', 
                      messages: [
                      type: 'success',
                      text: 'Hello World'
                      ]
                      );





                      share|improve this answer



























                        0














                        I'm not sure if you already solved this or not, but here it goes anyway. While Rakesh might be right (a controller is the preferred way), it doesn't answer the question. I found the easiest way of doing this is through the customerData object:



                        customerData.set('messages', 
                        messages: [
                        type: 'success',
                        text: 'Hello World'
                        ]
                        );





                        share|improve this answer

























                          0












                          0








                          0







                          I'm not sure if you already solved this or not, but here it goes anyway. While Rakesh might be right (a controller is the preferred way), it doesn't answer the question. I found the easiest way of doing this is through the customerData object:



                          customerData.set('messages', 
                          messages: [
                          type: 'success',
                          text: 'Hello World'
                          ]
                          );





                          share|improve this answer













                          I'm not sure if you already solved this or not, but here it goes anyway. While Rakesh might be right (a controller is the preferred way), it doesn't answer the question. I found the easiest way of doing this is through the customerData object:



                          customerData.set('messages', 
                          messages: [
                          type: 'success',
                          text: 'Hello World'
                          ]
                          );






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Feb 17 at 9:30









                          Jisse ReitsmaJisse Reitsma

                          930717




                          930717



























                              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%2f209657%2fmagento-2-add-success-message-with-knockout%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

                              Jet Time Laivasto | Lähteet | Aiheesta muualla | NavigointivalikkoJet Time - The CompanyThe CompanyManagementJet Time aloittaa lauantaina Suomi-rekisterissä olevalla Boeing 737 -koneellaJettime Finland Fleet Details and HistoryJettime Fleet Details and HistoryRegional Jet OÜ takes over ATR production for SASJet Time Returns To Its Core BusinessYhtiön kotisivutlaajentamalla

                              Olympian arkeologinen museo Sisällysluettelo Historia ja rakennus | Kokoelmat | Lähteet | Aiheesta muualla | Navigointivalikko37°38′36″N, 21°37′46″EInfobox OKArchaeological Museum of Olympia: HistoryArchaeological Museum of Olympia: DescriptionΜουσείο Ιστορίας των Ολυμπιακών Αγώνων της Αρχαιότητας: ΙστορικόArchaeological Museum of Olympia

                              Äpy Sisällysluettelo Äpyt kautta historian | Esimerkkejä Äpy-huumorista | Katso myös | Kirjallisuutta | Aiheesta muualla | Navigointivalikkowww.äpy.fi