0

I need to move the error messages at magento 2 checkout to the bottom of the page. I noticed that payment errors are within the "payment-method-content" div, but I didn't find a way to move elsewhere. How can I do this?

  • well, it will move success message too. is it OK ? – Pawan Jul 24 at 2:29
  • Yes, it will solve my problem. – Raphael Cordeiro Jul 24 at 3:06
0

Create checkout_index_index.xml at:

app/design/frontend/{Package}/{theme}/Magento_Checkout/layout

with following content

<?xml version="1.0"?>
<page layout="checkout" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="page.messages" destination="before.body.end" />
    </body>
</page>

Hope above will help!

  • If page.messages not work, you can use messages instead. – Pawan Jul 24 at 3:33
  • I've tried this two ways, but it don't works :/ – Raphael Cordeiro Jul 24 at 18:32
  • When I try to do this, i see a console error. "Options cannot be loaded" – Raphael Cordeiro Jul 24 at 19:01
  • Sorry, the error is "Options is undefined" – Raphael Cordeiro Jul 24 at 19:11

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.