Magento:获取当前货币的价格

Magento:获取当前货币的价格,magento,Magento,我有一个扩展,显示在标签页主页上的产品。它使用以下代码来获取产品的价格 $price=$\u product->getPrice() 然后使用以下代码显示它 echo''。数字格式($price,2)。' 它在基础货币上正常工作,但当选择其他货币时,它不会将价格转换为该货币 如何以当前货币显示价格?试试这个 $price = number_format($price,2); $formatedPrice = Mage::helper('core')->currency($price, t

我有一个扩展,显示在标签页主页上的产品。它使用以下代码来获取产品的价格

$price=$\u product->getPrice()

然后使用以下代码显示它

echo''。数字格式($price,2)。'

它在基础货币上正常工作,但当选择其他货币时,它不会将价格转换为该货币

如何以当前货币显示价格?

试试这个

$price = number_format($price,2);

$formatedPrice = Mage::helper('core')->currency($price, true, false);

echo '<span class="price">'.$formatedPrice.'</span>'
$price=number\u格式($price,2);
$formattedprice=Mage::helper('core')->currency($price,true,false);
回显“.$FormattedPrice.”