Tuesday, 17 April 2018

How to get current Currency and symbol in PHTML File in magento 2 ?


    <?php
        $_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();
    ?>

1 comment: