Magento – where can i remove the resultnumber for search

ce-1.9.0.1search

enter image description herewhen adding a search term,sometimes ther eis a dropdown with results sowing also a number before it (the number of expected results?)

Is that a setting somewhere or would i need to do something in code?

thanks

Best Answer

To explain what happens during your search auto-suggest, I add some information about the search-functionality related to this here:

Searching for 'trousers' (actually 'trou') in the demo shop: GET http://demo.magentocommerce.com/catalogsearch/ajax/suggest/?q=trou gives you the following return via AJAX:

<div id="search_autocomplete" class="search-autocomplete" style="position: absolute; left: 0px; top: 40px; width: 300px; display: none;">
  <ul>
    <li class="selected" style="display:none"></li>
    <li class="odd first" title="trousers">
       <span class="amount">1</span>
       trousers
    </li>
    <li class="even last" title="trouser">
       <span class="amount">4</span>
       trouser
    </li>
  </ul>
</div>

From the request above you can see that the suggestAction from the CatalogSearch AjaxController.php is called. The suggestAction calls $this->getResponse()->setBody($this->getLayout()->createBlock('catalogsearch/autocomplete')->toHtml()); to return the search-output. Opening app/code/core/Mage/CatalogSearch/Block/Autocomplete.php you will see that the HTML-code for your autosuggest-text is created there which is shown above.

In the _toHtml() function there is an inline-element named <span class="amount"> which shows the number of results for the term. You might have a CSS-rule for .amount or one of the other CSS-classes around .search-autocomplete which were modified. Or there might have been someone/something rewriting the app/code/core/Mage/CatalogSearch/Block/Autocomplete.php block class.