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

What were wait-states, and why was it only an issue for PCs?

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

Will I be more secure with my own router behind my ISP's router?

Short story about an alien named Ushtu(?) coming from a future Earth, when ours was destroyed by a nuclear explosion

When does Bran Stark remember Jamie pushing him?

How to charge percentage of transaction cost?

Pointing to problems without suggesting solutions

false 'Security alert' from Google - every login generates mails from 'no-reply@accounts.google.com'

Why doesn't the university give past final exams' answers?

Like totally amazing interchangeable sister outfit accessory swapping or whatever

Does traveling In The United States require a passport or can I use my green card if not a US citizen?

Who's this lady in the war room?

Who can become a wight?

"Destructive force" carried by a B-52?

What could prevent concentrated local exploration?

Putting Ant-Man on house arrest

Does using the Inspiration rules for character defects encourage My Guy Syndrome?

Coin Game with infinite paradox

Do chord progressions usually move by fifths?

Suing a Police Officer Instead of the Police Department

Converting a text document with special format to Pandas DataFrame

Salesforce - multiple pre production environments

Assertions In A Mock Callout Test

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



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;








3















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 3 hours ago


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





















    3















    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 3 hours ago


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

















      3












      3








      3








      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

      162




      162





      bumped to the homepage by Community 3 hours 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 3 hours 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

                              Nidaros erkebispedøme

                              Birsay

                              Was Woodrow Wilson really a Liberal?Was World War I a war of liberals against authoritarians?Founding Fathers...