Відповіді:
Спробуйте це:
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);