开发者

Magento: Price, formatted but without currency symbol

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜