Mark
12/02/2024, 3:43 PMCeligo AI
12/02/2024, 3:43 PMAI generated answer (using internal Slack threads):In Suite Commerce Advanced, you can use the
afterAppendView
event to show a message after logging in. This event is triggered after the view is rendered and appended to the DOM. You can listen to this event in your extension and then display your message.
Here is a basic example of how you can do this:
javascript
define('MyExtension'
, [
'Header.Profile.View'
, 'jQuery'
]
, function (
HeaderProfileView
, jQuery
) {
'use strict';
return {
mountToApp: function mountToApp (container) {
var layout = container.getComponent('Layout');
layout.addChildViews('Header.Profile.View', {
'Header.Profile.View': {
'Header.Profile.View': {
childViewIndex: 1,
childViewConstructor: function () {
return function () {
this.on('afterAppendView', function (view) {
if (view instanceof HeaderProfileView) {
jQuery('<div>Your message here</div>').appendTo('body');
}
});
};
}()
}
}
});
}
};
});
In this example, we are adding a child view to the Header.Profile.View
which is displayed after a user logs in. The afterAppendView
event is then used to append a message to the body of the page.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
12/02/2024, 3:43 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.820415437
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819117546
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814476
Celigo AI
12/02/2024, 3:43 PM