Jump to content

[SOLVED] Javascript autocomplete error with Quicksearch in Left Column


Recommended Posts

Hi,

I wonder if anybody can help. In Internet Explorer, I keep getting the 'done but with errors on page' javascript syntax error. Having already searched the forum for a solution, I did find out that this is due to a problem with the autocomplete not being found for the JavaScript search function and the fact that I have transplanted the quicksearch module to the left column from the header. It is not an option for me to put it back to the top of page as the design requires it be in the left column. I also tried the solution posted here:

http://www.prestashop.com/forums/viewthread/41777/configuring___using_prestashop/solved___search_query_dot_autocomplete_is_not_a_function_

but inserting this script into the header.tpl did not fix the error.

I would be really grateful if anybody could help me fix the Javascript error so I can keep the quicksearch in the left column and not have any errors appear in the IE.

I think this is the troublesome code (error line starred):

[removed]

       function formatSearch(row) {
           return row[2] + ' > ' + row[1];
       }

       function redirectSearch(event, data, formatted) {
           $('#search_query').val(data[1]);
           document.location.href = data[3];
       }

       $('document').ready( function() {
           $("#search_query").autocomplete(
               '/search.php', {
               minChars: 3,
               max:10,
               width:500,
               scroll: false,
               formatItem:formatSearch,
********   extraParams:{ajaxSearch:1,id_lang:} *****************
           }).result(redirectSearch)
       });

   [removed]




I am not very experienced with JavaScript or Prestashop so any help with fixing this would be much appreciated. Thanks in advance.

Link to comment
Share on other sites

  • 3 months later...
There is a bug in the "v1.1 theme compatibility" that causes this problem. You need to add the following code after line 182 of init.php:

'cookie' => $cookie,



I get this same error but only on my index page. I have added an extra hook to a top navbar that has a working search with autocomplete on all other pages.
Link to comment
Share on other sites

  • 2 years later...

I'm getting this error and I have know idea what's going on, it only happens in IE.

 

 

Webpage error details

 

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; LEN2; Alexa Toolbar)

Timestamp: Wed, 27 Jun 2012 04:31:12 UTC

 

 

Message: 'jQuery' is undefined

Line: 1

Char: 1

Code: 0

URI: http://localhost/ico...autocomplete.js

 

 

My config. Both are set to NO.

 

 

Ajax search

enabled.gif Yes disabled.gif No

Enable ajax search for your visitors.

With ajax search, the first 10 products matching the user query will appear in real time below the input field.

 

Instant search:

enabled.gif Yes disabled.gif No

Enable instant search for your visitors.

With instant search, the results will appear immediately as the user writes a query.

 

 

It's happening on search_top

Edited by chetwyn (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...