3

I am trying to extend the Header (logo, search box and cart), but those files are the different location. I don't know how to adjust those. Could you please suggest me on this.

enter image description here

3
  • exactly what do you want to do? Commented Dec 8, 2016 at 11:36
  • @Rakesh logo should be left search box should be middle and cart should be right. Is it possible to these codes comes under one file?
    – Bojjaiah
    Commented Dec 8, 2016 at 11:37
  • This not possible to come these code in one file. Commented Dec 8, 2016 at 11:59

3 Answers 3

3

Change below style:

.header.content {
    text-align: center;
}

.logo {
    float: none;
    display: inline-block;
}
.block-search {
    float: none;
    display: inline-block;
}
.minicart-wrapper {
    float: none;
}

Change below code in Magento_Checkout\layout\default.xml

<block class="Magento\Checkout\Block\Cart\Sidebar" name="minicart" as="minicart" after="top.search" template="cart/minicart.phtml">
2

The search position is set in the magento-search/view/frontend/layout/default.xml but the issue is that the minicart is set to have the position after "logo" you need to change this in magento-checkout/view/frontend/layout/default.xml

<block class="Magento\Checkout\Block\Cart\Sidebar" name="minicart" as="minicart" after="logo" template="cart/minicart.phtml">

change to

<block class="Magento\Checkout\Block\Cart\Sidebar" name="minicart" as="minicart" after="top.search" template="cart/minicart.phtml">

and after this style the top search so it shouldn't be with a float: right; ( adapt the style as you like )

Also, it is recomanded to make the changes for the checkout module files in app/design/frontend/YOUR_COMPANY/YOUR_THEME/Magento_Checkout/layout/default.xml

0
Move search box follow step :

step-1 :- opne Admin 
step-2 :- CONTENT > Block > Home Page Block > show - hide edit button click

add css in style tag

.header.content { text-align: center; } .block-search { float: none; display: inline-block; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.