Magento 1.9 – Search Autocomplete Not Working in Desktop View but Fine in Mobile Layout

autocompletecatalogsearchmagento-1.9

Here is the URL:

http://digitalupstarts.com/hof/

Open this URL in desktop and mobile, and type "marco" in the search bar. You will find that in desktop the autosuggest is not working, and in mobile autosuggest is working fine.

Here is the full code of form.min.phtml:

<form id="search_mini_form" action="<?php echo $catalogSearchHelper->getResultUrl() ?>" method="get">

<!--- Categories dropdown for Search -->

<?php /*$_helper = Mage::helper('catalog/category') */?><!--
<?php /*$_categories = $_helper->getStoreCategories() */?>
<?php /*$currentCategory = Mage::registry('current_category') */?>
<?php /*if (count($_categories) > 0): */?>
    <select id="category" class="myinput-text required-entry widthinput" name="category">
            <?php /*foreach($_categories as $_category): */?>
                <option value="<?php /*echo $_helper->getCategoryUrl($_category) */?>"><?php /*echo $_category->getName() */?></option>
                    <?php /*$_category = Mage::getModel('catalog/category')->load($_category->getId()) */?>
                    <?php /*$_subcategories = $_category->getChildrenCategories() */?>
                    <?php /*if (count($_subcategories) > 0): */?>
                            <?php /*foreach($_subcategories as $_subcategory): */?>
                                 <option value="<?php /*echo $_helper->getCategoryUrl($_subcategory) */?>"><?php /*echo '|--'.$_subcategory->getName() */?></option>
                            <?php /*endforeach; */?>
                    <?php /*endif; */?>
            <?php /*endforeach; */?>
        </select>
    --><?php /*endif; */?>
    <!--- End : Categories dropdown for Search -->


    <div class="form-search">

        <div class="search-content">

           <!-- <label for="search"><?php //echo $this->__('Search:') ?></label>-->
            <input id="search" type="text" name="<?php echo $catalogSearchHelper->getQueryParamName() ?>" onfocus="if(this.value == 'Search Here...') { this.value = ''; }" onblur="this.value=!this.value?'Search Here...':this.value;" value="Search Here..." class="input-text" maxlength="<?php echo $catalogSearchHelper->getMaxQueryLength();?>" />
            <button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><i class="icon-search"></i></button>
            <div id="search_autocomplete" class="search-autocomplete"></div>
            <script type="text/javascript">
            //<![CDATA[
                var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search...') ?>');
                searchForm.initAutocomplete('<?php echo $catalogSearchHelper->getSuggestUrl() ?>', 'search_autocomplete');
            //]]>
            </script>
        </div>
    </div>
</form>

Best Answer

Here is a Picture: enter image description here

Have you changed somthing? I think script work only for the first search. I think in this case it doesn`t matter that is hidden. I hope this will help you something.

Related Topic