{"id":9769,"date":"2013-03-07T17:56:09","date_gmt":"2013-03-07T12:26:09","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=9769"},"modified":"2013-03-08T13:48:47","modified_gmt":"2013-03-08T08:18:47","slug":"how-to-add-currency-selector-in-header-of-magento","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/","title":{"rendered":"How to add currency selector in header of Magento"},"content":{"rendered":"<p>\nIn magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento.\n<\/p>\n<p>\nFirst of all setup your desired currencies for your store from magento admin. Now create a new template file and put it under following directory structure :\n<\/p>\n<p>\napp\/design\/frontend\/your_package\/your_theme\/template\/currency\/currency.phtml\n<\/p>\n<p>[php]<br \/>\n&lt;?php if($this-&gt;getCurrencyCount() &gt; 1): ?&gt;<br \/>\n&lt;div class=&quot;form-language&quot;&gt;<br \/>\n    &lt;label for=&quot;currency-selector&quot;&gt;&lt;?php echo $this-&gt;__(Currency&#8217;) ?&gt;&lt;\/label&gt;<br \/>\n    &lt;select onchange=&quot;window.location.href=this.value&quot; name=&quot;currency-selector&quot; id=&quot;currency-selector&quot;&gt;<br \/>\n        &lt;?php foreach ($this-&gt;getCurrencies() as $code =&gt; $name): ?&gt;<br \/>\n        &lt;option value=&quot;&lt;?php echo $this-&gt;getSwitchCurrencyUrl($code)?&gt;&quot;<br \/>\n            &lt;?php if($code == $this-&gt;getCurrentCurrencyCode()): ?&gt;<br \/>\n                selected=&quot;selected&quot;<br \/>\n            &lt;?php endif; ?&gt;&gt;<br \/>\n            &lt;?php echo $name ?&gt;<br \/>\n        &lt;\/option&gt;<br \/>\n        &lt;?php endforeach; ?&gt;<br \/>\n    &lt;\/select&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;?php endif; ?&gt;<br \/>\n[\/php]<\/p>\n<p>\nNow create following file so that magento use this file to render currency selector.\n<\/p>\n<p>\napp\/design\/frontend\/your_package\/your_theme\/layout\/local.xml\n<\/p>\n<p>[php]<br \/>\n&lt;?xml version=&quot;1.0&quot;?&gt;<br \/>\n&lt;layout version=&quot;0.1.0&quot;&gt;<br \/>\n    &lt;default&gt;<br \/>\n        &lt;reference name=&quot;header&quot;&gt;<br \/>\n            &lt;block type=&quot;directory\/currency&quot; name=&quot;my_currency_selector&quot; template=&quot;currency\/currency.phtml&quot;\/&gt;<br \/>\n        &lt;\/reference&gt;<br \/>\n    &lt;\/default&gt;<br \/>\n&lt;\/layout&gt;<br \/>\n[\/php]<\/p>\n<p>\nNow open app\/design\/frontend\/your_package\/your_theme\/page\/html\/header.phtml and add following line :\n<\/p>\n<p>[php]<br \/>\n&lt;?php echo $this-&gt;getChildHtml(&#8216;my_currency_selector&#8217;) ?&gt;<br \/>\n[\/php]<\/p>\n<p>\nThat&#8217;s it. Hope this will help you.\n<\/p>\n<p>\n<br \/>\nRegards,<br \/>\nAmatya Trivedi<br \/>\namatya@intelligrape.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento. First of all setup your desired currencies for your store from magento admin. Now create a new template file and [&hellip;]<\/p>\n","protected":false},"author":62,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":8,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9769","post","type-post","status-publish","format-standard","hentry","category-technology"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento. First of all setup your desired currencies for your store from magento admin. Now create a new template file and\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"amatya\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"How to add currency selector in header of Magento | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"In magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento. First of all setup your desired currencies for your store from magento admin. Now create a new template file and\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to add currency selector in header of Magento | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento. First of all setup your desired currencies for your store from magento admin. Now create a new template file and\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/#article\",\"name\":\"How to add currency selector in header of Magento | TO THE NEW Blog\",\"headline\":\"How to add currency selector in header of Magento\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2013-03-07T17:56:09+05:30\",\"dateModified\":\"2013-03-08T13:48:47+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/#webpage\"},\"articleSection\":\"Technology\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/#listItem\",\"name\":\"How to add currency selector in header of Magento\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/#listItem\",\"position\":3,\"name\":\"How to add currency selector in header of Magento\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/\",\"name\":\"amatya\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98bb25c159475972796bfc713a7342c003e4b5ec97c0405283e939843153e6ee?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"amatya\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/\",\"name\":\"How to add currency selector in header of Magento | TO THE NEW Blog\",\"description\":\"In magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento. First of all setup your desired currencies for your store from magento admin. Now create a new template file and\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-add-currency-selector-in-header-of-magento\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amatya\\\/#author\"},\"datePublished\":\"2013-03-07T17:56:09+05:30\",\"dateModified\":\"2013-03-08T13:48:47+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to add currency selector in header of Magento | TO THE NEW Blog","description":"In magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento. First of all setup your desired currencies for your store from magento admin. Now create a new template file and","canonical_url":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/#article","name":"How to add currency selector in header of Magento | TO THE NEW Blog","headline":"How to add currency selector in header of Magento","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"datePublished":"2013-03-07T17:56:09+05:30","dateModified":"2013-03-08T13:48:47+05:30","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/#webpage"},"articleSection":"Technology"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/www.tothenew.com\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/#listItem","name":"How to add currency selector in header of Magento"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/#listItem","position":3,"name":"How to add currency selector in header of Magento","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/","name":"amatya","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/98bb25c159475972796bfc713a7342c003e4b5ec97c0405283e939843153e6ee?s=96&d=mm&r=g","width":96,"height":96,"caption":"amatya"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/","name":"How to add currency selector in header of Magento | TO THE NEW Blog","description":"In magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento. First of all setup your desired currencies for your store from magento admin. Now create a new template file and","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/amatya\/#author"},"datePublished":"2013-03-07T17:56:09+05:30","dateModified":"2013-03-08T13:48:47+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"How to add currency selector in header of Magento | TO THE NEW Blog","og:description":"In magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento. First of all setup your desired currencies for your store from magento admin. Now create a new template file and","og:url":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"How to add currency selector in header of Magento | TO THE NEW Blog","twitter:description":"In magento by default currency selector renders in right side bar. To show it in the header is not a hard job. This blog will let you know about moving it to header of magento. First of all setup your desired currencies for your store from magento admin. Now create a new template file and","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"9769","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-30 08:08:02","updated":"2024-02-29 10:52:24","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to add currency selector in header of Magento\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"Technology","link":"https:\/\/www.tothenew.com\/blog\/category\/technology\/"},{"label":"How to add currency selector in header of Magento","link":"https:\/\/www.tothenew.com\/blog\/how-to-add-currency-selector-in-header-of-magento\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/9769","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=9769"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/9769\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=9769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=9769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=9769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}