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

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

How to get a single big right brace?

Is "ein Herz wie das meine" an antiquated or colloquial use of the possesive pronoun?

A German immigrant ancestor has a "Registration Affidavit of Alien Enemy" on file. What does that mean exactly?

How to break 信じようとしていただけかも知れない into separate parts?

Coin Game with infinite paradox

Trying to enter the Fox's den

Is Bran literally the world's memory?

Can 'non' with gerundive mean both lack of obligation and negative obligation?

What helicopter has the most rotor blades?

reduction from 3-SAT to Subset Sum problem

How to charge percentage of transaction cost?

Does using the inspiration rules for character defects tend to encourage players to display MGS?

When speaking, how do you change your mind mid-sentence?

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

Can I take recommendation from someone I met at a conference?

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

Why do C and C++ allow the expression (int) + 4*5?

Unix AIX passing variable and arguments to expect and spawn

How do I overlay a PNG over two videos (one video overlays another) in one command using FFmpeg?

Should man-made satellites feature an intelligent inverted "cow catcher"?

/bin/ls sorts differently than just ls

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

Why does BitLocker not use RSA?



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 mins 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 mins 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 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 3 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

                              Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

                              Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр

                              Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»