magento 删除 layout.xml 中的块

magento remove block in layout.xml

我为一些商品设置了分级定价。此模板用于产品视图页面:catalog/product/view/tierprices.phtml。我试图通过编辑 layout.xml 来删除它,但没有成功。我怎样才能删除这个块?

另一种方法是从基本布局复制 catalog.xml,将其复制到当前主题的布局文件夹中。在 catalog_product_view 句柄中,注释掉以下行:

<action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>

至:

<!--<action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>-->

这应该有效! :)

您无法通过布局更新将其删除。您将必须编辑 catalog/product/view.phtml 文件并注释掉 $this->getTierPriceHtml() 行。

getTierPriceHtml 在以下模板文件中也被调用:

bundle/catalog/product/view/type/bundle/option/radio.phtml
bundle/catalog/product/view/type/bundle/option/select.phtml
catalog/product/view/type/grouped.phtml