ronangr1 / module-flashmessages
Replace Magento 2 default messaging with flash messages.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 0
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- php: >=8.1
README
This module allows you to replace the Magento 2 default messaging system with flash messages.
Setup
Magento 2 Open Source or Commerce edition is required.
This module is compatible with the latest Magento version (2.4.8).
Installation
composer require ronangr1/module-flashmessages
Then
bin/magento setup:upgrade bin/magento setup:di:compile
Documentation
If enabled, the default messaging system is completely removed and replaced by the flash message system.
How to display a flash message
require(['flashManager'], function (flashManager) { // You can use the addMessage() function flashManager.addMessage([ { type: 'error', message: 'Something went wrong while processing.', } ]); // Or the enqueueMessage() function flashManager.enqueueMessage([ { type: 'warning', message: 'Entity saved but something went wrong while processing.', } ]); });
It already works with ajax call.
How to change the position of the flash message?
Go to Store > Configuration > Ronangr1 > Flash Messages > Settings > Position
.
Support
Raise a new request to the issue tracker.
Authors
License
This project is licensed under the MIT License - see the LICENSE details.
That's all folks!