比較ブロックを削除するためにこれを変更するファイル
-
12-12-2019 - |
質問
www.domain.com/customer/address/edit/id/1 / に進むとき
住所を編集できる場所
何らかの理由で左側のサイドバーでブロック比較があります
これを削除するにはどのファイルを編集する必要がありますか?
ありがとう
カルロ
私のlayout.xmlで(アプリ/デザイン/フロントエンド/ Mythemackage / 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>
. 解決
独自のモジュールを使用していないと仮定すると、Location app/design/frontend/[package]/[theme]/layout/local.xml
でローカルレイアウトファイルを作成し、デフォルトで追加された比較ブロックを参照していると仮定して、ファイルに次のものを追加する必要があります。
<?xml version="1.0"?>
<layout version="0.1.0">
<customer_account>
<remove name="catalog.compare.sidebar" />
</customer_account>
</layout>
.
しかしこれは、catalog.compare.sidebar
を使用している場合は、ブロック名(<remove>
)を再利用できないことを意味します。レイアウト内で同じブロック名を再使用したい場合は、代わりに次のように使用します。
<?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 Themesの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"/>
所属していません magento.stackexchange