3
votes

How to remove search box from home page in magento.

I searched in CMS > Pages > home page, no code related to search box was available.

I can remove search box in every catalog view and product view page using this link

"http://www.magentocommerce.com/boards/viewthread/38420/".

How to remove from home page.

Thanks in Advance.

4

4 Answers

1
votes

Go to the app/design/frontend/YOUR_THEME_NAME/default/template/page/html/header.php Line no:- 38 Please Use this code.

<?php echo $this->getChildHtml('topSearch') ?>

to

<?php if(Mage::getSingleton('cms/page')->getIdentifier() != 'home'  && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms') : ?>

<?php echo $this->getChildHtml('topSearch') ?>

<?php endif;?>
1
votes

you can remove by xml

Create local.xml under app/design/frontend/yourpakcage/yourtemplate/layout/

Code of

<?xml version="1.0"?>
<layout version="0.1.0">
  <cms_index_index >
    <reference name="root">
    <remove name="top.search" />
        </reference>
    </cms_index_index>
</layout>
1
votes

use following xml

<?xml>
<layout>
  <default>    
     <reference name="header">
       <remove name="top.search" />
     </reference>
    </default>
</layout>
0
votes

you can remove the search function from the home page using a layout update. on the page you wish to remove this from, goto the design tab. In the 'custom design' tab and in the 'Custom layout update XML' box add in the following:

<remove name="top.search" />

This will remove the search box from this page only. Worked for me when all i wanted to do was remove the top search from the home page only.