1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

call search form in custom module Magento 1.9

Discussion in 'Programming/Internet' started by inrsaurabh, Aug 1, 2020.

  1. inrsaurabh

    inrsaurabh Guest

    I want to show mini search form when i hover on one of the main category (Men Women ... ) at red area, as marked in below image.

    This menu is shown using a custom extension. Is there any way in which i can call default search form in that custom module.


    <?xml version="1.0"?>
    <layout version="0.1.0">

    <block type="custommenu/toggle"></block>
    <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>


    To temporarily solve my issues I did something like below in one of the blocks files app/code/community/WP/CustomMenu/Block

    public function getSearchBlock( ) {
    $html ='<form id="search_mini_form" class="search-form" action="http://websitename.com/catalogsearch/result/" method="get">
    <input style="padding: 2px 4px 2px 5px;" id="search" type="search" name="q" value="" class="input-text required-entry" maxlength="128" placeholder="Search" autocomplete="off">
    <button type="submit" class="button-search-submit"></button>
    return $html;

    and then call above function at an appropriate position. I know above method is not suggested. [​IMG]

    Login To add answer/comment

Share This Page