Answers:
试试这个:
Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
存储货币代码,例如 美元
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
存储货币符号,例如 $
$currency_symbol = Mage::app()->getLocale()->currency( $currency_code )->getSymbol();
商店货币名称,例如 美元
$currency_name = Mage::app()->getLocale()->currency( $currency_code)->getName();
尝试:
$currencyCode = '';
$currency = $order->getOrderCurrency(); //$order object
if (is_object($currency)) {
$currencyCode = $currency->getCurrencyCode();
}
$currencySymbol = Mage::app()->getLocale()->currency($currencyCode)->getSymbol();
var_dump($currencySymbol);
使用任何给定的货币代码,您可以使用Zend_Locale得出符号:
$curr = new Zend_Currency('en_US');
echo $curr->getSymbol();
只需传递变量..中的值即可返回当前货币格式的价格
$Formatted_Price = Converted Price with Currency
$Variable_Price = Your Variable value
$Formatted_Price= Mage::helper('core')->currency($Variable_Price, true, false);