Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Possible to add global records search to regular search on front end? 
 
nickanderson
Jr. Member
 
Total Posts:  10
Joined:  2008-06-22
 

Hi, I really like how when you start typing in the global record search in the admin tool that it starts displaying matches as you type. 

Is it possible to have the front end search do this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
NoamDesign
Jr. Member
 
Total Posts:  7
Joined:  2008-05-19
 

I have been looking into this issue for a while now and have not come up with any results so I will post this issue here. 

In the admin section for magento when I enter a search term into the ‘global record search’ field at the top of the page, the please wait animation appears yet no search results are returned. The page basically freezes and the I have to close the browser in order to continue any work.

I would greatly appreciate any help in finding a solution to this issue.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

It uses javascript (duh)

this is how it’s done on the page:

<legend>Search</legend>

            <
span id="global_search_indicator" class="autocomplete-indicator" style="display: none">
                <
img src="http://chris-fidaos-computer.local/~Chris/magento/skin/adminhtml/default/default/images/ajax-loader.gif" alt="Loading..." class="v-middle"/>
            </
span>
                        <
input id="global_search" name="query" type="text" class="input-text" value="Global Record Search" onfocus="if(this.value=='Global Record Search')this.value=''; " onblur="if(this.value=='')this.value='Global Record Search';" />
            <
div id="global_search_autocomplete" class="autocomplete"></div>
            <
script type="text/javascript">
                new 
Ajax.Autocompleter(
                    
'global_search',
                    
'global_search_autocomplete',
                    
'http://mysite.com/magento/index.php/admin/index/globalSearch/',
                    
{
                        paramName
:"query",
                        
minChars:2,
                        
indicator:"global_search_indicator",
                        
updateElement:getSelectionId
                    }
                
);
                function 
getSelectionId(li{
                    location
.href li.getAttribute('url');
                
}
            </script>
        
</fieldset>

Hard part will be checking the Admin controller and seeing how it’s functioning....

app/code/core/mage/adminhtml/controllers/IndexController.php
Check out the function:  globalSearchAction()

(you can track that via the URL being called - http://mysite.com/magento/index.php/admin/index/globalSearch/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top