Currently, Our compare product print page showing the footer section on that.
I want to remove the footer link in compare product print page.
How to do that.
Thanks.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityThe Compare Products Page footer link is getting rendered from the below layout XML file. Copy the below file from the vendor path to your current theme.
vendor/magento/module-catalog/view/frontend/layout/catalog_product_compare_index.xml
<?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="page.main.title">
<action method="setPageTitle">
<argument translate="true" name="page_title" xsi:type="string">Compare Products</argument>
</action>
</referenceBlock>
<referenceContainer name="content">
<block class="Magento\Catalog\Block\Product\Compare\ListCompare" name="catalog.compare.list" template="Magento_Catalog::product/compare/list.phtml" cacheable="false"/>
</referenceContainer>
</body>
</page>
Add the below lines to remove the footer section
<referenceContainer name="footer-container" remove="true"/>
<referenceBlock name="copyright" remove="true" />
The Final Version should look like this
<?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="page.main.title">
<action method="setPageTitle">
<argument translate="true" name="page_title" xsi:type="string">Compare Products</argument>
</action>
</referenceBlock>
<referenceContainer name="content">
<block class="Magento\Catalog\Block\Product\Compare\ListCompare" name="catalog.compare.list" template="Magento_Catalog::product/compare/list.phtml" cacheable="false"/>
</referenceContainer>
<referenceContainer name="footer-container" remove="true"/>
<referenceBlock name="copyright" remove="true" />
</body>
</page>