由於在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>
IAM不是100%肯定,這將工作,但它也許是開始爲你
可以指定你想做? –
我需要在Mage_Catalog_Block_Product_Price中重寫_toHtml()以解析產品頁面的html(爲HTML標籤添加豐富的片段屬性) – sergei