Search the Community
Showing results for tags 'orderbyorderwaypncms'.
-
Je me permets de créer ce topique, n'ayant pas trouvé de solution équivalente pour la 1.4.X.X Ce code ne fonctionne pas chez moi, J'ai la version 1.4.4.1 /* CODE A INSERER A PARTIR D'ICI */ /***** Test et correction des URL non valides *****/ if((!(isset($_GET['id_product']) AND Validate::isUnsignedId($_GET['id_product'])))&&(strpos($_SERVER["REQUEST_URI"],"/productquestion/")===false)&&(strpos($_SERVER["REQUEST_URI"],"/sendtoafriend/")===false)) { // Nous sommes sur une page produit $cookie = new Cookie('ps'); Tools::setCookieLanguage(); $product = new Product(intval($_GET['id_product']), true, intval($cookie->id_lang)); if (Validate::isLoadedObject($product) AND $product->active) { $goodurl=$_GET['id_product']."-".$product->link_rewrite.".html"; // URL theorique $currenturl=basename($_ENV['REQUEST_URI']); // URL courante $redir=strcmp($goodurl, $currenturl); if($redir!=0) { // Pas la bonne URL donc redirection HTTP 301 vers l'URL correcte header('HTTP/1.1 301 Moved Permanently', false, 301); header("Location: http://" . $_SERVER["SERVER_NAME"] ."/". $goodurl); exit(); } }; } if (isset($_GET['id_category']) AND Validate::isUnsignedId($_GET['id_category'])) { // Nous sommes sur une page Categorie $cookie = new Cookie('ps'); Tools::setCookieLanguage(); $category = new Category(intval(Tools::getValue('id_category')), intval($cookie->id_lang)); if (Validate::isLoadedObject($category) AND $category->active) { $paramurl=""; // Detection d'un eventuel numero de page if (isset($_GET['p'])) { $varpagenumber=$_GET['p']; if($varpagenumber>1) { $paramurl="?p=$varpagenumber"; $smarty->assign('nobots', 1); // variable Smarty de Prestashop qui appose la valeur "noindex,follow" dans la balise META Robots }; }; if (isset($_GET['n'])) { $varpagenumber=$_GET['n']; if($varpagenumber>1) { $paramurl.=(empty($paramurl)?"?":"&")."n=$varpagenumber"; $smarty->assign('nobots', 1); // variable Smarty de Prestashop qui appose la valeur "noindex,follow" dans la balise META Robots }; }; // Detection des variables eventuelles de tri de produits if (isset($_GET['orderby'])) { $varorderby=$_GET['orderby']; $paramurl.=(empty($paramurl)?"?":"&")."orderby=$varorderby"; $smarty->assign('nobots', 1); // variable Smarty de Prestashop qui appose la valeur "noindex,follow" dans la balise META Robots }; if (isset($_GET['orderway'])) { $varorderway=$_GET['orderway']; $paramurl.=(empty($paramurl)?"?":"&")."orderway=$varorderway"; $smarty->assign('nobots', 1); // variable Smarty de Prestashop qui appose la valeur "noindex,follow" dans la balise META Robots }; $goodurl=$_GET['id_category']."-".$category->link_rewrite.$paramurl; // URL theorique $currenturl=basename($_ENV['REQUEST_URI']); // URL courante $redir=strcmp($goodurl, $currenturl); if($redir!=0) { // Pas la bonne URL donc redirection HTTP 301 vers l'URL correcte header('HTTP/1.1 301 Moved Permanently', false, 301); header("Location: http://" . $_SERVER["SERVER_NAME"] ."/". $goodurl); exit(); } }; } // FIN DU CODE A INSERER Y a-il une solution pour avoir NOINDEX / FOLLOW sur les pages contenant les variables : 'orderby''orderway''p''n' Pour les versions 1.4.x.x. Module, code, bref une solution autre que le robot.txt et autre manipulation google webmatertool. Merci pour vos propositions.