Magento: Price, formatted but without currency symbol

前端 未结 4 424
北海茫月
北海茫月 2020-12-20 14:38

I want to get a formatted price but without the currency symbol and I want use only standard functionality of magento!

$product->getFinalPrice(); => 19         


        
相关标签:
4条回答
  • 2020-12-20 15:23
    Mage::helper('core')->currency($product->getFinalPrice(), false, false);
    
    0 讨论(0)
  • 2020-12-20 15:24
    Mage::getModel('directory/currency')->format(
        $product->getFinalPrice(), 
        array('display'=>Zend_Currency::NO_SYMBOL), 
        false
    );
    
    0 讨论(0)
  • 2020-12-20 15:24

    Just below one line code is needed for that. Try this

    Mage::helper('core')->currency($_yourPriceToFormat, false, false);
    
    0 讨论(0)
  • 2020-12-20 15:36

    You could use the directory/currency model:

    Mage::getModel('directory/currency')->formatTxt(
        $product->getFinalPrice(),
        array('display' => Zend_Currency::NO_SYMBOL)
    );
    
    0 讨论(0)
提交回复
热议问题