We have a custom template file and want to display it on all the pages except the checkout page. However, it shows even in checkout page. We have used the below code in our theme default.xml.

<container name="footer.newsletter" htmlTag="div" htmlClass="home-newsletter textcenter white-text" after="home.customers">
                <block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe.home" template="Magento_Newsletter::subscribe.phtml" ifconfig="newsletter/general/active"/>

Can anyone please help me on how to remove it from checkout page?


Add your block in default.xml and in checkout_index_index.xml write below code:

<referenceBlock name="form.subscribe.home" remove="true" />

It will solve your issue.

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.