Jump to content

[Resolu] BlockSearch renvois constamment le même résultat


Steeve.c

Recommended Posts

Bonjour,

 

Je travail actuellement sur http://www.figurines-cine.com , le module de recherche blocksearch-top.pl rangé dans l'en-tête du site, me renvois constamment le même résultat.

 

Cependant, si je commence a taper une recherche sans valider avec entré ou le bouton submit, javascript me liste les propositions en dessous et je peux obtenir le résultat souhaité.

 

Mais il serait préférable qu'une personne tape sa recherche et valide le formulaire pour se retrouver avec une liste de produit qui colle a la recherche.

 

Le plus étonnant, c'est que le module semble pourtant bien fonctionner, car il m'indique le nombre de résultat trouvé ce qui correspond bien au nombre qu'il est sensé m'afficher.

 

Par exemple si je recherche "vador" il me dit 2 résultat trouvé, mais m'affiche une autre liste, et il y a bien deux article qui contiennent le mot vador. Si je rentre une référence produit, il m'indique bien, 1 résultat trouvé, et m'affiche toujours la même liste.

 

Quelqu'un aurait il un indice ? ou quel est le fichier tpl ou php qui affiche les résultats ?

 

Merci

Link to comment
Share on other sites

Nouvelle info, en ayant retiré le module de flash 3D, un genre de carrousel qui fait tourner les produit sur un plateau, je n'ai plus la liste de résultat habituel, mais du vide a la place, alors qu'il trouve bel et bien des résultats.

 

recherchevide.jpg

 

Même en supprimant complètement le module, je n'ai aucun resultat

Link to comment
Share on other sites

J'ai trouvé !

 

Donc le module "Featured Products in 3D" dénature le résultat de recherche, je suppose qu'il utilise la même variable de row des résultat...

 

Voic le Xml du module qui pose probleme

 

 

<?xml version="1.0" encoding="UTF-8" ?>

<module>

<name>flash3d</name>

<displayName><![CDATA[Featured Products in 3D]]></displayName>

<version><![CDATA[1.2]]></version>

<description><![CDATA[Displays Featured Products in the middle of your homepage - www.catalogo-onlinersi.com.ar]]></description>

<author><![CDATA[RSI]]></author>

<tab><![CDATA[front_office_features]]></tab>

<is_configurable>1</is_configurable>

<need_instance>0</need_instance>

<limited_countries></limited_countries>

</module>

 

 

Et donc, ceci couplé au code qui était modifié dans controllers/SearchController.php

 

Les ligne suivi de //DEPRECATED (since to 1.4) étaient désactivé, donc aucun produit en ressortait, j'ai simplement du les re-activer

 

 

if ($this->instantSearch && !is_array($query))

{

$this->productSort();

$this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));

$this->p = abs((int)(Tools::getValue('p', 1)));

$search = Search::find((int)(self::$cookie->id_lang), $query, $this->p, $this->n, $this->orderBy, $this->orderWay);

Module::hookExec('search', array('expr' => $query, 'total' => $search['total']));

$nbProducts = $search['total'];

$this->pagination($nbProducts);

self::$smarty->assign(array(

'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module

'search_products' => $search['result'],

'nbProducts' => $search['total'],

'search_query' => $query,

'instantSearch' => $this->instantSearch,

'homeSize' => Image::getSize('home')));

}

elseif ($query = Tools::getValue('search_query', Tools::getValue('ref')) AND !is_array($query))

{

$this->productSort();

$this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));

$this->p = abs((int)(Tools::getValue('p', 1)));

$search = Search::find((int)(self::$cookie->id_lang), $query, $this->p, $this->n, $this->orderBy, $this->orderWay);

Module::hookExec('search', array('expr' => $query, 'total' => $search['total']));

$nbProducts = $search['total'];

$this->pagination($nbProducts);

self::$smarty->assign(array(

'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module

'search_products' => $search['result'],

'nbProducts' => $search['total'],

'search_query' => $query,

'homeSize' => Image::getSize('home')));

}

elseif ($tag = urldecode(Tools::getValue('tag')) AND !is_array($tag))

{

$nbProducts = (int)(Search::searchTag((int)(self::$cookie->id_lang), $tag, true));

$this->pagination($nbProducts);

$result = Search::searchTag((int)(self::$cookie->id_lang), $tag, false, $this->p, $this->n, $this->orderBy, $this->orderWay);

Module::hookExec('search', array('expr' => $tag, 'total' => sizeof($result)));

self::$smarty->assign(array(

'search_tag' => $tag,

'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module

'search_products' => $result,

'nbProducts' => $nbProducts,

'homeSize' => Image::getSize('home')));

}

 

Et voila, tadam, le résultat des recherches devient niquel

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