Jump to content

Strange Fix For Ajax Funcionality Through Blocksearch


Recommended Posts

Good day everyone..

I'm currently using an updated prestashop from 1.2.5 to 1.3.1 with all SQL tables not only inserted
but also updated to the new 1.3.1 standard (as there are a few extra columns in the new version).

Only basic modules installed, and a customized theme (I customized it).
Hosted on Linux, PHP version: 5.2.8, MySQL version: 5.0.90.


I had everything in place and working as it should be...
except for the ajax functionality that would not work unless I uninstalled blocksearch.

I then tried some edits in blocksearch.tpl and successfully unblocked the ajax functionality.

I only edited line 36 of blocksearch.tpl from this:

extraParams:{ajaxSearch:1,id_lang:{/literal}{$cookie->id_lang}{literal[spam-filter]



To this:

extraParams:{ajaxSearch:1,id_lang:3{$cookie->id_lang}{literal[spam-filter]



And the ajax funcionality worked. (yes, my default language is number 3)

Now even though everything is working perfectly, I get this firefox console error:

missing } after property list
                 extraParams:{ajaxSearch:1,id_lang:3{$cookie->id_lang}{literal[spam-filter]\n



I know this error is related to the {/literal} tag I removed.
However it just freezes the ajax funcionality when it is there, very strange.

And I just noticed that with the original line in place I get this firefox console error:

$("#search_query").autocomplete is not a function
                  extraParams:{ajaxSearch:1,id_lang:3} 



Dreaweaver also accuses line 36 with a red highlight (the original unedited file).

Anyone have any clues why this original code gives this error?

And also, my main question:
Can this edited line cause any real problem in the future?

I've tested every functionality and everything works perfectly fine despite the firefox error.


Thanks in advance.

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