PrestaShop Forums: [SOLVED] Javascript autocomplete error with Quicksearch in Left Column - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


[SOLVED] Javascript autocomplete error with Quicksearch in Left Column


[SOLVED] Javascript autocomplete error with Quicksearch in Left Column

#1 potski205

    PrestaShop Newbie

  • 09 Nov 2009
  • Members
  • Pip
  • 4 posts

Posted 08 February 2010 - 11:48 PM

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.prestasho...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.

#2

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 09 February 2010 - 04:42 AM

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,


#3

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 09 February 2010 - 05:39 PM

Thank you so much, it worked. This has been driving me crazy for ages so your help is very much appreciated.

#4

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 17 May 2010 - 11:53 PM

From 1265686946:

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users