php - Magento custom search form -


i trying create custom search functionality in magento 1.9. instead of writing scratch, want piggy default search functionality , add in custom filters. first copied form.min template , replaced drop downs want use.

form.custom.phtml:

<?php $catalogsearchhelper =  $this->helper('catalogsearch');  $_helper = mage::helper('catalog/category'); $_categories = $_helper->getstorecategories(); ?>  <form id="search_custom_form" action="<?php echo $catalogsearchhelper->getresulturl() ?>" method="get">      <div class="select-box item">         <label for="finder">gift finder</label>         <select id="customs" name="finder">             <option value="">please select</option>             <?php              foreach ($_categories $key => $value) {                 echo("<option value='" . $value["name"] . "'>" . $value["name"] . "</option>");             }             ?>         </select>     </div>      <div class="item">         <label for="for">for</label>         <select id="for">             <option value="">please select</option>             <option value="him">him</option>             <option value="her">her</option>         </select>     </div>      <div classs="item">         <label for="delivery">delivery option</label>         <select id="delivery">             <option value="express">express delivery</option>             <option value="standard">standard post</option>         </select>     </div>      <div classs="item">         <label for="price">delivery option</label>         <select id="price">             <option value="<250">less £250</option>             <option value=">250">more £250</option>         </select>     </div>      <button type="submit" title="<?php echo $this->__('find') ?>" class="button search-button"><span><span><?php echo $this->__('find') ?></span></span></button>      <script type="text/javascript">     //<![cdata[         var searchform = new varien.searchform('search_custom_form', '', '');     //]]>     </script> </form> 

i have included above template on home page using {{block type="core/template" name="custom-search" as="custom-search" template="catalogsearch/form.custom.phtml"}}, have copied core files own template folder , find myself stuck. can offer better alternative or solution should do?

thanks

found easier option here. copied catalogsearch folder theme, copied advanced search form , placed on home page. can customise form , query see fit.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -