我有一个扩展程序,可以在标签页的主页上显示产品。它使用以下代码获取产品的价格
$price = $_product->getPrice();
然后用下面的代码显示出来
echo '<span class="price">'.number_format($price,2).'</span>'
It works OK on the base currency but when another currency is selected it will not convert the price to that currency.
如何以当前货币显示价格?
最佳答案
试试这个
$price = number_format($price,2);
$formatedPrice = Mage::helper('core')->currency($price, true, false);
echo '<span class="price">'.$formatedPrice.'</span>'
关于Magento:以当前货币获取价格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32478328/