2013-12-11 135 views
0

當價格設置爲動態時,我怎麼能得到捆綁產品的原始價格(價格不包括特價 - 何時設置)?Magento捆綁產品原價

我想是這樣的:

<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol().number_format($_product->getPrice(),2) ?> 

但它僅適用於固定的價格,如果價格是動態的,它顯示出0.00

最好的是方法,將兩個價格工作:固定和動態

回答

1

見的應用程序/設計/前端/鹼/默認/模板/束/目錄/產品/ price.phtml

$_product  = $this->getProduct(); 
$_priceModel = $_product->getPriceModel(); 

list($_minimalPriceTax, $_maximalPriceTax) = $_priceModel->getTotalPrices($_product, null, null, false); 
list($_minimalPriceInclTax, $_maximalPriceInclTax) = $_priceModel->getTotalPrices($_product, null, true, false); 

string〜128 - 使用動態類型格式化捆綁包價格。

<?php if ($_minimalPriceTax <> $_maximalPriceTax): ?> 
0

這會給你捆綁產品動態含稅價Mage::getModel('bundle/product_price')->getTotalPrices($_product,'max',1);

這會給你捆綁產品動態價格不含稅Mage::getModel('bundle/product_price')->getTotalPrices($_product,'max',0);

只要正確地傳遞你的產品對象。

相關問題