J'ai vu un post pour supprimer la catégorie de l'url de cette manière :
cela se passe dans le fichier Link.php à la ligne 41 et 44 du 'getProductLink'
public function getProductLink($id_product, $alias = NULL, $category = NULL, $ean13 = NULL, $id_lang = NULL)
{
if (!isset($this->allow)) $this->allow = 0;
if (is_object($id_product))
return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink(intval($id_lang)).(($id_product->category != 'home' AND !empty($id_product->category)) ? $id_product->category.'/' : '').intval($id_product->id).'-'.$id_product->link_rewrite.($id_product->ean13 ? '-'.$id_product->ean13 : '').'.html') :
(_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product->id));
elseif ($alias)
return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink(intval($id_lang)).(($category AND $category != 'home') ? ($category.'/') : '').intval($id_product).'-'.$alias.($ean13 ? '-'.$ean13 : '').'.html') :
(_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product));
else
return _PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product);
}
Suppression des catégories lignes 41:
.(($id_product->category != 'home' AND !empty($id_product->category)) ? $id_product->category.'/' : '')
et 44:
.(($category AND $category != 'home') ? ($category.'/') : '')
Je retrouve donc ceci:
public function getProductLink($id_product, $alias = NULL, $category = NULL, $ean13 = NULL, $id_lang = NULL)
{
if (!isset($this->allow)) $this->allow = 0;
if (is_object($id_product))
return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink(intval($id_lang)).intval($id_product->id).'-'.$id_product->link_rewrite.($id_product->ean13 ? '-'.$id_product->ean13 : '').'.html') :
(_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product->id));
elseif ($alias)
return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink(intval($id_lang)).intval($id_product).'-'.$alias.($ean13 ? '-'.$ean13 : '').'.html') :
(_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product));
else
return _PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product);
}
L'url est maintenant de cette forme:
Quote
Je voudrai l'ID du produit à la fin: modif ligne 44
return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink(intval($id_lang)).$alias.'-'.intval($id_product).($ean13 ? '-'.$ean13 : '').'.html') :
L'url est maintenant:
Quote
Pile-poil sauf que je me retrouve avec une belle page
'La page que vous avez demandée n'existe plus'
Arffff, c'était bien parti :-S
Une petite idée ?
Contact (9am-6pm EST) +1-888-947-6543


Back to top









