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')->foobar($product->getFinalPrice()); => 19,99
How is that possible? (I don't want use str_replace()...)
You can use following code: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $currencysymbol = $objectManager->get('Magento\Directory\Model\Currency'); echo $currencysymbol->getCurrencySymbol();
Mage::getModel('directory/currency')->format(
$product->getFinalPrice(),
array('display'=>Zend_Currency::NO_SYMBOL),
false
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With