Magento2 Custom Header – Add Currency Switcher Dropdown

currencycustomheadermagento2theme

I created custom header using below link.
http://oxsoftwares.com/add-custom-header-in-custom-theme-magento2/

I want to add currency switcher inside the custom header, how can we call currency switcher inside custom header.

Best Answer

You need to add following code into your default.xml file.

<referenceBlock name="custom_header">
     <block class="Magento\Directory\Block\Currency" name="currency" before="-" template="currency.phtml"/>
</referenceBlock>

And add below code into your customheader.phtml

<?php echo $this->getChildHtml('currency'); ?>
Related Topic