2011-07-18 71 views

回答

3

试试这个:

<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?> 
+1

此代码不显示当前区域的价格 – Bizboss

28
$formattedPrice = Mage::helper('core')->currency($_finalPrice,true,false); 
+4

投票赞成第一个提供答案(接受的答案只有此信息后添加) –

+0

...和接受的答案应该原本被标记为链接专门删除的答案 –

11

做到这一点通过在产品列表

echo Mage::helper('core')->currency($_product->getPrice()); 
3

未格式化这个代码格式化的价格和格式化:

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

或使用:

Mage::helper('core')->formatPrice($price, true); 
+0

OMG我爱你哈哈! – zaw

14

用于格式化价格另一种货币比当前:

Mage::app()->getLocale()->currency('EUR')->toCurrency($price); 
+1

正是我期待的! – blakey87

+1

这是我一直在寻找 –

-4

这是一个迷人的答案。适用于商店选择的任何货币。

$formattedPrice = Mage::helper('core')->currency($finalPrice, true, false); 
+1

这只是从5年前的答案.. – TT120