2

This just suddenly showed up in my left sidebar. It says "My Orders" with a list of past purchases and an "Add to Cart" button. What is this? The block hint is "Magento\Sales\Block\Reorder\Sidebar".

I've tried "referenceBlock name="sidebar.Reorder" remove="true" in my default.xml but that doesn't work.

Any help is appreciated. Thanks.

V 2.0.13 Luma child theme

1
  • please let me know if you have issue. Commented Apr 13, 2017 at 5:58

2 Answers 2

1

You have to keep below code in your default.xml file to remove unnecessary block from sidebar.

 <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" layout="3columns">
        <body>    
            <!-- Compare and wishlist sidebar -->
            <referenceBlock name="catalog.compare.sidebar" remove="true"/>
            <referenceBlock name="wishlist_sidebar" remove="true" />
            <!-- Recently order -->
            <referenceBlock name="sale.reorder.sidebar" remove="true" />
            <!-- additional sidebar block -->
            <referenceContainer name="sidebar.additional" remove="true" />
        </body>
    </page>
2
  • Thanks Rakesh! that worked. But only in my vendor/magento/module-theme/view/frontend/layout/default.xml. Nothing seems to be registering in the /app/design/frontend/myvendor/myvendor_theme/layout/default.xml. Any idea why? I thought child directories overwrote the base.
    – guest
    Commented Apr 13, 2017 at 7:52
  • You have to keep default.xml file into app/design/frontend/myvendor/myvendor_theme/Magento_Theme/layout/default.‌​xml Commented Apr 13, 2017 at 8:40
0

My Orders is created by the Magento_Sales module in view/frontend/layout/default.xml by the following code:

<referenceContainer name="sidebar.additional">
        <block class="Magento\Sales\Block\Reorder\Sidebar" name="sale.reorder.sidebar" as="reorder" template="reorder/sidebar.phtml"/>
</referenceContainer>

The answer @Rakesh posted removes the block but also the parent container, the best way to remove the My Orders block is to edit your child themes catalog_category_view.xml. located at app/design/frontend/VENDOR/THEME/Magento_Catalog/layout/catalog_category_view.xml

<?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>

            <referenceContainer name="sidebar.additional">

                <referenceBlock name="sale.reorder.sidebar" remove="true" />

            </referenceContainer>

        </body>
    </page>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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