skip to Main Content

How to add header and footer to checkout page. I used the override method. I created checkou_index_index.xml file in following path layoutoverridethemeMagentoblank in my custom theme.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="minicart" remove="false" />
    <referenceContainer name="header.panel" remove="false" />
    <referenceBlock name="top.search" remove="false" />
    <referenceBlock name="catalog.compare.link" remove="false" />
    <referenceBlock name="catalog.topnav" remove="false"/>
    <referenceContainer name="footer-container"  remove="false"/>
</body>
</page>

But I received following error.

Overriding view file 'C:/xampp/htdocs/my_website/app/design/frontend/Vendor/basic/Magento_Checkout/layout/override/theme/Magento/blank/checkout_index_index.xml' does not match to any of the files  

What is the cause of this error and how to fix this error?

2

Answers


  1. Try putting your custom xml file in:

    C:xampphtdocsmy_websiteappdesignfrontendVendorbasicMagento_Checkoutviewfrontendlayoutcheckout_index_index.xml
    

    Because, if i’m not mistaken, the file to override is in:

    C:xampphtdocsmy_websitevendormagentomodule-checkoutviewfrontendlayoutcheckout_index_index.xml
    

    Hope this helps you.

    Login or Signup to reply.
  2. First you have to create custom theme and once its done then create checkout_index_index.xml file in app/design/frontend/Magenticians/Mytheme/Magento_Checkout/layout and paste this code:

    <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="minicart" remove="false" />
        <referenceContainer name="header.panel" remove="false" />
        <referenceBlock name="top.search" remove="false" />
        <referenceBlock name="catalog.compare.link" remove="false" />
        <referenceBlock name="catalog.topnav" remove="false"/>
        <referenceContainer name="footer-container"  remove="false"/>
    </body>
    </page>
    

    Then create customcss.css in app/design/frontend/Magenticians/Mytheme/web/css and paste this code:

    .action-auth-toggle
    {
    display: block;
    }
    

    Now open a default.xml file of your custom theme and paste this code:

    <head>
            <css src="css/customcss.css" />
    </head>
    

    After the implementation, don’t forget to run necessary CLI commands.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search