Hello !
I need you! I have to make a search engine according to some criterion (price(prize), surface and city) that the chosen person.
Here is my code:
$parametres = array(
'element' => 'getResources',
'elementClass' => 'modSnippet',
'parents' => $modx->resource->get('id'),
'depth' => 2,
'limit' => 3,
'pageVarKey' => 'page',
'includeTVs' => 1,
'includeContent' => 1,
'includeTVList' => 'ma_tv,description_terrain,tarif,ref,logo_constructeur,adresse,tel,site_constructeur',
'tpl' => 'article',
'processTVs' => 1,
'pageLastTpl' => '<li class="control"><a[[+title]] href="[[+href]]">Dernière page</a></li>',
'pageFirstTpl' => '<li class="control"><a[[+title]] href="[[+href]]">Première page</a></li>',
);
if ($_GET['Lieu']!=="none"){
$ville=$_GET['Lieu'];
$choix2 = strtoupper($_GET['prix']).$_GET['sup'].$_GET['Lieu'];
switch ($choix2) {
case "A0$ville":
$parametres = array_merge($parametres, array(
'tvFilters' => 'adresse_terrain==$ville',
));
return $modx->runSnippet('getPage', $parametres);
break;
}
}
I want that the parameters are sorted out according to the city where the chosen person. The problem it is because I do not manage to translate the $ville because when I puts that, it does not work. On the other hand if I filled with a chaine of character it work!
Can you help me ?
Excuse me for my English !