Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design
Showing posts with label header. Show all posts
Showing posts with label header. Show all posts

How to add or enable currency switcher in header Magento

If you want to enable currency switcher in your header than follow this easy step.

Currency switcher Magento

Step 1: Admin setting
You might have noticed the ”Currency Setup” tab in Magento’s Administration under “System->Configuration” menu. There you should select default site currency, and besides that, all currencies you want to support.

Magento Currency switcher

After that, you should go to “System->Manage Currency Rates” and set rates for currencies you’ve chosen before. You can use Webservicex to import currency rates from Webservicex service. Here’s how it looks like:

Magento Currency switcher

Step 2: Open /app/design/frontend/default/[YOUR THEME]/layout/page.xml
Add this line of code
<block type="directory/currency" name="currency" template="directory/currency.phtml"/>
After
<block type="page/html_header" name="header" as="header">

Step 3: Open /app/design/frontend/default/[YOUR THEME]/template/page/html/header.phtml
Add
<?php echo $this->getChildHtml('currency') ?>
After
<?php echo $this->getChildHtml('store_language') ?>

How to Move sidebar cart To Header Magento

Moving Mini-cart to header in magento is really simple you just need to change your xml and you are done with it. below are steps by which we can move mini cart.

Step1. Open checkout.xml from location given below

/design/frontend/default/[your theme]/layout/checkout.xml

find the code below in file.

<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml"/>

Step2. now open page.xml can be found at location given below

\design\frontend\default\[your theme]\layout\page.xml

in this file find the code given below

<block type="page/html_header" name="header" as="header">

paste the the cart_sidebar block as shown below.

<block type="page/html_header" name="header" as="header">
    <block type="page/template_links" name="top.links" as="topLinks"/>
    <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
    <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
    <label>Navigation Bar</label>

    <!--new added block -->
<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml"/>
    <!--end new block -->
    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>

Clear your cache.
Thats its............

Hit like or leave comment if post help!

 

Copyright @ 2017 HKBlog.