I want to get a formatted price but without the currency symbol and I want use only standard functionality of magento!
$product->getFinalPrice(); => 19.9900
Mage::helper('core')->formatPrice($product->getFinalPrice(), false); => 19,99 €
Mage::helper('mymodul')-&g开发者_如何学JAVAt;foobar($product->getFinalPrice()); => 19,99
How is that possible? (I don't want use str_replace()...)
Mage::getModel('directory/currency')->format(
$product->getFinalPrice(),
array('display'=>Zend_Currency::NO_SYMBOL),
false
);
Just below one line code is needed for that. Try this
Mage::helper('core')->currency($_yourPriceToFormat, false, false);
You could use the directory/currency
model:
Mage::getModel('directory/currency')->formatTxt(
$product->getFinalPrice(),
array('display' => Zend_Currency::NO_SYMBOL)
);
Mage::helper('core')->currency($product->getFinalPrice(), false, false);
精彩评论