2010-05-28 106 views
3

我試圖使用我的自定義模板顯示捆綁產品的列表。我無法顯示捆綁產品的動態價格。以前對於我使用的簡單產品:獲得Magento中捆綁產品的「低至」價格

$product->getPrice(); 

哪些工作,但它只顯示捆綁項目0.00美元。

看着../catalog/products/list.phtml我試圖

$this->$getPriceHtml($product, true); 

我的塊延伸到Mage_Catalog_Block_Product_Abstract我簡單的產品重新工作後,但捆綁的產品仍然顯示$ 0.00包裝

有另一種顯示價格與動態捆綁價格一樣低的方式?

我清除緩存並重新編制索引,以及所有好東西。價格在默認類別列表下正確顯示,不在我的自定義頁面下。

更新

我一直無法找出一個替代。當我做的產品集合,包含價格捆綁產品領域的轉儲如下:

["price_type"] => string(1) "0" 

["price_view"] => string(1) "0" 
    ["_price_index"] => bool(true) 
    ["_price_index_min_price"] => string(8) "475.0000" 
    ["_price_index_max_price"] => string(8) "475.0000" 
    ["tax_percent"] => float(9) 
    ["final_price"] => int(0) 

對於簡單的產品,我只得到:

["price"] => string(8) "248.0000" 
["final_price"] => string(8) "248.0000" 

,所以我想我可以寫我自己函數來獲取價格取決於產品的類型,但我猜有一個更好的辦法...

+1

的Magento的版本? – 2010-05-29 00:12:48

+0

抱歉,延遲響應。我使用1.3.2,但最終還是想開始進入1.4。 今天,我還在我們的銷售產品區塊中添加了一個捆綁產品(這是其他人添加的),我注意到了同樣的問題。捆綁產品顯示爲0.00美元。 – dardub 2010-06-01 18:30:23

+0

1.3.2.2更精確 – dardub 2010-06-01 18:45:41

回答

1

看看/app/design/frontend/base/deafault/layout/bundle.xml

<catalog_category_default> 
    <reference name="product_list"> 
     <action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action> 
    </reference> 
</catalog_category_default> 

你應該添加你的自定義phtml(不需要控制需要xml那樣做)。從你的包/目錄/產品/ price.phtml開始得到你所需要的所有功能;)好運氣