0

ハンドルcatalog_product_view専用にMage_Catalog_Block_Product_Priceを書き換える方法は? このブロックには、レイアウトで特定の名前がありません。

<catalog_product_view>
    <reference name="???">
        <block type="test/price" name="test.price />
    </reference>        
</catalog_product_view>
4

1 に答える 1

0

Magento では、製品タイプが価格のレンダリングに使用されるブロックを定義しているため、少し注意が必要です。多分これはうまくいくかもしれません:

お気に入りのレイアウト xml ファイルに移動し、これを追加します

<catalog_product_view>
    <reference name="catalog_product_price_template">
        <action method="addPriceBlockType"><type>simple</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
        <action method="addPriceBlockType"><type>virtual</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
        <action method="addPriceBlockType"><type>grouped</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
        <action method="addPriceBlockType"><type>downloadable</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
        <action method="addPriceBlockType"><type>configurable</type><block>yourmodule/catalog_product_price</block><template>catalog/product/price.phtml</template></action>
        <action method="addPriceBlockType"><type>bundle</type><block>yourmodule/bundle_catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
    </reference>
</catalog_product_view>

これがうまくいくとは100%確信が持てませんが、おそらくあなたにとってはスタートです

于 2013-09-24T22:03:27.977 に答える