0
我嘗試重寫getSelectionQtyTitlePrice方法 我在賓夕法尼亞州創建了一個文件 My_Bundle.xml如何重寫方法getSelectionQtyTitlePrice
<?xml version="1.0" ?>
<config>
<modules>
<My_Bundle>
<active>true</active>
<codePool>local</codePool>
</My_Bundle>
</modules>
</config>
- >系統 - >高級模塊存在,並在應用程序能夠 /代碼/地方/我/包/座/目錄/產品/瀏覽/類型/包 Option.php
class My_Bundle_Block_Catalog_Product_View_Type_Bundle_Option extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option
{
public function getSelectionQtyTitlePrice($_selection, $includeContainer = false)
{
$price = $this->getProduct()->getPriceModel()->getSelectionPreFinalPrice($this->getProduct(), $_selection);
$this->setFormatProduct($_selection);
$priceTitle = $_selection->getSelectionQty()*1 . ' x ' . $this->escapeHtml($_selection->getName());
$priceTitle .= ' ' . ($includeContainer ? '<span class="price-notice">' : '')
. '' . $this->formatPriceString($price, $includeContainer)
. ($includeContainer ? '</span>' : '');
return $priceTitle;
}
}
在app /代碼/地方/我/包的/ etc/config.xml中
<?xml version="1.0"?>
<config>
<modules>
<My_Bundle>
<version>0.0.1</version>
</My_Bundle>
</modules>
<global>
<blocks>
<bundle>
<rewrite>
<catalog_product_view_type_bundle_option>My_Bundle_Block_Catalog_Product_View_Type_Bundle_Option</catalog_product_view_type_bundle_option>
</rewrite>
</bundle>
</blocks>
</global>
</config>
但該解決方案不重寫getSelectionQtyTitlePrice方法。 THX求助