0

where is function to remove all messages (add or error)? I want to remove message one by one, now magento deletes all at once.

1

Try This Code

app/code/VendoreName/ModuleName/view/frontend/layout

default.xml

<?xml version="1.0"?>

<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <referenceContainer name="page.messages" remove="true" />
        </referenceContainer>
    </body>
</page>
0
<referenceContainer name="page.messages" remove="true" />

Add this in app/design/frontend/[your theme]/Magento_Theme/layout/default.xml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.