Here is the URL:


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; */?>
    --><?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">
                var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search...') ?>');
                searchForm.initAutocomplete('<?php echo $catalogSearchHelper->getSuggestUrl() ?>', 'search_autocomplete');
  • which extension you are using or any custom theme? – Manoj Deswal Oct 27 '17 at 7:45
  • Extension name is "magento-autocomplete-master" – Pranav Makwana Oct 27 '17 at 8:39

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.

|improve this answer|||||

maybe in the desktop view the JS is missing. I found it in the mobile template but not in the desktop view:

<script type="text/javascript" src="http://digitalupstarts.com/hof//js/magebuzz/searchautocomplete/ajaxsearch.js"></script>

Is the autocomplete/autocomplete.phtml in the template folder?

|improve this answer|||||
  • thank you so much for your reply but its not working. please help me out. client will kill me – Pranav Makwana Oct 27 '17 at 8:25
  • Can you look in your form.mini.phtml? Maybe post the content? I think there is something missing. Or you can compare the code from the mobile and the desktop template. Have you a sandbox to test? – Marcel Oct 27 '17 at 8:42
  • can i have your contact number please? – Pranav Makwana Oct 27 '17 at 8:54
  • And there is no such folder called "autocomplete" in whole directory. – Pranav Makwana Oct 27 '17 at 8:57
  • sorry I can not give you telephone support. Have you found your form.mini.phtml in the main template? – Marcel Oct 27 '17 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.