[*] CORE: original search_query assign to .tpl
Avoid problems with special characters for eg. in polish language like ąźćłó etc.
This commit is contained in:
@@ -91,6 +91,7 @@ class SearchControllerCore extends FrontController
|
|||||||
$this->productSort();
|
$this->productSort();
|
||||||
$this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));
|
$this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));
|
||||||
$this->p = abs((int)(Tools::getValue('p', 1)));
|
$this->p = abs((int)(Tools::getValue('p', 1)));
|
||||||
|
$original_query = Tools::safeOutput($query);
|
||||||
$query = Tools::replaceAccentedChars(urldecode($query));
|
$query = Tools::replaceAccentedChars(urldecode($query));
|
||||||
$search = Search::find($this->context->language->id, $query, $this->p, $this->n, $this->orderBy, $this->orderWay);
|
$search = Search::find($this->context->language->id, $query, $this->p, $this->n, $this->orderBy, $this->orderWay);
|
||||||
foreach ($search['result'] as &$product)
|
foreach ($search['result'] as &$product)
|
||||||
@@ -105,7 +106,7 @@ class SearchControllerCore extends FrontController
|
|||||||
'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module
|
'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module
|
||||||
'search_products' => $search['result'],
|
'search_products' => $search['result'],
|
||||||
'nbProducts' => $search['total'],
|
'nbProducts' => $search['total'],
|
||||||
'search_query' => $query,
|
'search_query' => $original_query,
|
||||||
'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
|
'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
|
||||||
}
|
}
|
||||||
elseif (($tag = urldecode(Tools::getValue('tag'))) && !is_array($tag))
|
elseif (($tag = urldecode(Tools::getValue('tag'))) && !is_array($tag))
|
||||||
|
|||||||
Reference in New Issue
Block a user