4

when going to www.domain.com/customer/address/edit/id/1/

where one can edit their address

for some reason there is a block compare in left sidebar

what file do i need to edit to remove this?

Thanks

Carlo

In my layout.xml (app/design/frontend/mythemepackage/default/layout/local.xml)

i have this:

 <!-- CUSTOMER ACCOUNT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<customer_account>

    <reference name="left">
        <!-- Remove cart from the left column -->
        <action method="unsetChild"><name>cart_sidebar</name></action>

        <!-- Remove Compare block, it is already inserted in DEFAULT section -->
        <action method="unsetChild"><name>catalog.compare.sidebar</name></action>
    </reference>

</customer_account>

the default section it refers to is this i guess in same file:

<?xml version="1.0" encoding="UTF-8"?>

<!-- Left ====================================================================== -->
    <reference name="left">
        <remove name="left.newsletter"/> <!-- Moved newsletter to the footer -->
        <action method="unsetChild"><name>left.permanent.callout</name></action>
        <action method="unsetChild"><name>left.reports.product.viewed</name></action>
      <block type="catalog/product_compare_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
        <!--  <block type="reports/product_compared" name="right.reports.product.compared" template="reports/product_compared.phtml" />
       <block type="reports/product_viewed" name="left.reports.product.viewed" template="reports/product_viewed.phtml" />
       <block type="wishlist/customer_sidebar" name="wishlist_sidebar" as="wishlist" template="wishlist/sidebar.phtml"/>
       <block type="poll/activePoll" name="right.poll">
           <action method="setPollTemplate"><template>poll/active.phtml</template><type>poll</type></action>
           <action method="setPollTemplate"><template>poll/result.phtml</template><type>results</type></action>
       </block>
       <block type="tag/popular" name="tags_popular" template="tag/popular.phtml"/>
       <block type="paypal/logo" name="paypal.partner.right.logo" template="paypal/partner/logo.phtml"/> -->

        <action method="unsetChild"><name>tags_popular</name></action>
        <action method="unsetChild"><name>cart_sidebar</name></action>
        <action method="unsetChild"><name>right.reports.product.compared</name></action>
        <action method="unsetChild"><name>right.reports.product.viewed</name></action>
        <action method="unsetChild"><name>wishlist</name></action>
        <action method="unsetChild"><name>sale.reorder.sidebar</name></action>
        <action method="unsetChild"><name>right.poll</name></action>
        <action method="unsetChild"><name>paypal.partner.right.logo</name></action>
    </reference>

3 Answers 3

1

Assuming you are not using your own module, you should create a local layout file at location app/design/frontend/[package]/[theme]/layout/local.xml and assuming you are seeing the compare block which is added by default you should add the following into the file:

<?xml version="1.0"?>
<layout version="0.1.0">
    <customer_account>
        <remove name="catalog.compare.sidebar" />
    </customer_account>
</layout>

However this does mean that you will not be able to re-use the block name (catalog.compare.sidebar) if you use <remove>. If you want to re-use the same block name within the layout then use the following instead:

<?xml version="1.0"?>
<layout version="0.1.0">
    <customer_account>
        <reference name="left">
            <action method="unsetChild">
                <name>catalog.compare.sidebar</name>
            </action>
        </reference>
    </customer_account>
</layout>
20
  • Jonathan, when i add that xml to app/design/frontend/[package]/[mytheme]/layout it messed up the whole site... i guess that has something to do with layout version? (that is not in local.xml file that is in package/default
    – carlo
    Nov 17, 2014 at 15:41
  • If local.xml does not exist then you can just create it, it will be automatically found so you add the local.xml file within the layout directory with the above contents if that's not what you have done. Nov 17, 2014 at 15:45
  • yes i have done that but it is as it doesn't read the main local.xml anymore app/design/frontend/[package]/[mytheme]/layout.xml Point is that [mytheme] has default and subs in it... default already has this file (with all kinds of configuration in it) so when i add another xml file in the sub i use it does not load the one in default i guess
    – carlo
    Nov 17, 2014 at 15:47
  • If you already have local.xml just add the <customer_account> section above into your existing layout file... Nov 17, 2014 at 15:51
  • I checked and that is already in that file... so for some reason there is another instance? It has this comment: <!-- Remove Compare block, it is already inserted in DEFAULT section -->
    – carlo
    Nov 17, 2014 at 15:56
1

try this

<customer_address_edit>
<reference name="left">
 <remove name="catalog.compare.sidebar" />
</reference>
<customer_address_edit>
0

In magento 2 add below lines in themes's default.xml file

\app\design\frontend\default\Magento_Theme\layout\default.xml

<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="catalog.compare.link" remove="true"/>

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.