开发者

Magento: Price, formatted but without currency symbol

开发者 https://www.devze.com 2023-04-01 15:54 出处:网络
I want to get a formatted price but without the currency symbol and I want use only standard functionality of magento!

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

精彩评论

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