[-] FO : #PSFV-569 - Fix bug with instant search
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13593 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
12bc5a990c
commit
7e5c73c277
3 files changed
+16
-4
No files matched your search
@@ -435,8 +435,8 @@ class FrontControllerCore extends Controller
|
|||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'HOOK_HEADER' => $hook_header,
|
'HOOK_HEADER' => $hook_header,
|
||||||
'HOOK_TOP' => Hook::exec('displayTop'),
|
'HOOK_TOP' => Hook::exec('displayTop'),
|
||||||
'HOOK_LEFT_COLUMN' => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''),
|
'HOOK_LEFT_COLUMN' => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''),
|
||||||
'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''),
|
'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''),
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->display_header = $display;
|
$this->display_header = $display;
|
||||||
|
|||||||
@@ -40,7 +40,14 @@ class SearchControllerCore extends FrontController
|
|||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
$this->instant_search = Tools::getValue('instantSearch');
|
$this->instant_search = Tools::getValue('instantSearch');
|
||||||
|
|
||||||
$this->ajax_search = Tools::getValue('ajaxSearch');
|
$this->ajax_search = Tools::getValue('ajaxSearch');
|
||||||
|
|
||||||
|
if ($this->instant_search || $this->ajax_search)
|
||||||
|
{
|
||||||
|
$this->display_header = false;
|
||||||
|
$this->display_footer = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -65,14 +65,19 @@
|
|||||||
stopInstantSearchQueries();
|
stopInstantSearchQueries();
|
||||||
instantSearchQuery = $.ajax({
|
instantSearchQuery = $.ajax({
|
||||||
url: '{/literal}{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}{literal}',
|
url: '{/literal}{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}{literal}',
|
||||||
data: 'instantSearch=1&id_lang={/literal}{$cookie->id_lang}{literal}&q='+$(this).val(),
|
data: {
|
||||||
|
instantSearch: 1,
|
||||||
|
id_lang: {/literal}{$cookie->id_lang}{literal},
|
||||||
|
q: $(this).val()
|
||||||
|
},
|
||||||
dataType: 'html',
|
dataType: 'html',
|
||||||
|
type: 'POST',
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if($("#search_query_top").val().length > 0)
|
if($("#search_query_top").val().length > 0)
|
||||||
{
|
{
|
||||||
tryToCloseInstantSearch();
|
tryToCloseInstantSearch();
|
||||||
$('#center_column').attr('id', 'old_center_column');
|
$('#center_column').attr('id', 'old_center_column');
|
||||||
$('#old_center_column').after('<div id="center_column">'+data+'</div>');
|
$('#old_center_column').after('<div id="center_column" class="' + $('#old_center_column').attr('class') + '">'+data+'</div>');
|
||||||
$('#old_center_column').hide();
|
$('#old_center_column').hide();
|
||||||
$("#instant_search_results a.close").click(function() {
|
$("#instant_search_results a.close").click(function() {
|
||||||
$("#search_query_top").val('');
|
$("#search_query_top").val('');
|
||||||
|
|||||||
Reference in new issue
Block a user