转到www.domain.com/customer/address/edit/id/1 /

可以编辑他们的地址

出于某种原因,左侧栏中有一个块比较

我需要编辑哪些文件以删除此?

感谢

carlo

在我的layout.xml中(app / design / frontend / mythemapackage / default / layout / local.xml)

我有这个:

 <!-- 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>
.

默认部分是指的是我猜在同一文件中:

<?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>
.

有帮助吗?

解决方案

假设您不使用自己的模块,您应该在位置生成的本地布局文件,并假设您看到默认情况下添加的比较块您应该将以下内容添加到文件中:

<?xml version="1.0"?>
<layout version="0.1.0">
    <customer_account>
        <remove name="catalog.compare.sidebar" />
    </customer_account>
</layout>
. 但是,如果使用app/design/frontend/[package]/[theme]/layout/local.xml,则这确实意味着您将无法重用块名称(catalog.compare.sidebar)。如果要在布局中重新使用相同的块名,则使用以下内容:
<?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>
.

其他提示

试试这个

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

在Magento 2在主题的default.xml文件中添加以下行

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

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

许可以下: CC-BY-SA归因
scroll top