I am trying to show item price with symbol in override email template on order create, and my site have euro and $ both currency.
Is there any way to get current currency symbol
, Please share if have.
Try to use
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$priceHelper = $objectManager->get('Magento\Framework\Pricing\Helper\Data');
$priceHelper->currency($YOURPRICE, true, false);
Maybe it will help you.
I donot know,what extract you want.
In magento, whenever a system have multiple currencies means system have a base currency and have multiple currencies. And multiple currencies manage via rate,
Then whensoever an order placed at system and then base currency and order place time currency both codes are save at order table sales_order
.
You can find
base currency code from base_currency_code field
order time currency code from order_currency_code
To get the Currency Symbol :
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$priceHelper = $objectManager->create('Magento\Framework\Pricing\Helper\Data');
$price = 1000; //Your Price
$formattedPrice = $priceHelper->currency($price, true, false);
Currency code and symbol:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$currencysymbol= $objectManager
->get('Magento\Store\Model\StoreManagerInterface');
$currencyCode = $currencysymbol->getStore()->getCurrentCurrencyCode();
$currency = $objectManager
->create('Magento\Directory\Model\CurrencyFactory')
->create()->load($currencyCode);
$currencySymbol= $currency->getCurrencySymbol();
Simple way to get price with currency
$this->helper('Magento\Framework\Pricing\Helper\Data')->currency($price,true,false); //$price is final amount
protected $this->storeManage; \Magento\Store\Model\StoreManagerInterface $storeManage $this->storeManage = $storeManage $this->storeManager->getStore()->getCurrentCurrencyCode();
current currency symbol