How To Get Current Magento 2 Currency Symbol Programmatically

How can I get current currency symbol from Mangeto 2 template file programmatically.
You can use storeManager to get current currency code and retrieve the currency object. Then use method – getCurrencySymbol to get currency symbol.

 

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); 
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterfa‌​ce'); 
$code = $storeManager->getStore()->getCurrentCurrencyCode(); 
$currency = $objectManager->create('\Magento\Directory\Model\CurrencyFact‌​ory')->create()->loa‌​d($code); 
$symbol = $currency->getCurrencySymbol(); 
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments