ronangr1 / module-flashmessages
Replace Magento 2 global messages system with flash messages.
Package info
github.com/ronangr1/magento2-flashmessages
Type:magento2-module
pkg:composer/ronangr1/module-flashmessages
Requires
- php: >=8.1
- ronangr1/module-core: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This module allows you to replace the Magento 2 global messages 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 global messages system is completely removed and replaced by the flash message system.
How to display a flash message
require(['Ronangr1_FlashMessages/js/model/flash'], function (flash) { flash.add({ type: 'error', message: '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.
How to enable flash messages system ?
Go to Store > Configuration > Ronangr1 > Flash Messages > General > Enable
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!