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;
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
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.
add a comment |
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
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.
add a comment |
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
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
magento2 magento-2.1 knockoutjs messages
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.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Add success message in your controller it will automatically display in your page.
add a comment |
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'
]
);
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%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
Add success message in your controller it will automatically display in your page.
add a comment |
Add success message in your controller it will automatically display in your page.
add a comment |
Add success message in your controller it will automatically display in your page.
Add success message in your controller it will automatically display in your page.
answered Jul 5 '18 at 15:15
Rakesh VarmaRakesh Varma
75218
75218
add a comment |
add a comment |
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'
]
);
add a comment |
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'
]
);
add a comment |
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'
]
);
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'
]
);
answered Feb 17 at 9:30
Jisse ReitsmaJisse Reitsma
930717
930717
add a comment |
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%2f209657%2fmagento-2-add-success-message-with-knockout%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