Odpowiedzi:
Spróbuj tego:
Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
Przechowuj kod waluty, np. USD
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
przechowywać symbol waluty np. $
$currency_symbol = Mage::app()->getLocale()->currency( $currency_code )->getSymbol();
przechowuj nazwę waluty np. Dolar
$currency_name = Mage::app()->getLocale()->currency( $currency_code)->getName();
Próbować:
$currencyCode = '';
$currency = $order->getOrderCurrency(); //$order object
if (is_object($currency)) {
$currencyCode = $currency->getCurrencyCode();
}
$currencySymbol = Mage::app()->getLocale()->currency($currencyCode)->getSymbol();
var_dump($currencySymbol);
Za pomocą dowolnego kodu waluty możesz uzyskać symbol za pomocą Zend_Locale:
$curr = new Zend_Currency('en_US');
echo $curr->getSymbol();
Wystarczy podać wartość w zmiennej .. zwróci bieżącą cenę w formacie waluty
$Formatted_Price = Converted Price with Currency
$Variable_Price = Your Variable value
$Formatted_Price= Mage::helper('core')->currency($Variable_Price, true, false);