ASBARRR Posted August 6, 2010 Share Posted August 6, 2010 Bonjour,Je souhaiterais tronquer le nom du produit dans mon fil d'Ariane.Je pense que je dois faire les modifications dans le fichier products.php. $smarty->assign(array( 'return_link' => (isset($category->id) AND $category->id) ? Tools::safeOutput($link->getCategoryLink($category)) : '[removed] history.back();', 'path' => ((isset($category->id) AND $category->id) ? Tools::getFullPath(intval($category->id), $product->name) : Tools::getFullPath(intval($product->id_default_category), $product->name)) )); Je ne vois pas comment utiliser la fonction truncate dans cette situation.Je n'utilise Prestashop que depuis 5 jours. Je possède la dernière version stable.J'ai besoin d'aide ! Merci d'avance. Link to comment Share on other sites More sharing options...
amaury Posted August 6, 2010 Share Posted August 6, 2010 Essaye de remplacer : $smarty->assign(array( 'return_link' => (isset($category->id) AND $category->id) ? Tools::safeOutput($link->getCategoryLink($category)) : '[removed] history.back();', 'path' => ((isset($category->id) AND $category->id) ? Tools::getFullPath(intval($category->id), $product->name) : Tools::getFullPath(intval($product->id_default_category), $product->name)) )); par : $smarty->assign(array( 'return_link' => (isset($category->id) AND $category->id) ? Tools::safeOutput($link->getCategoryLink($category)) : '[removed] history.back();', 'path' => ((isset($category->id) AND $category->id) ? Tools::getFullPath(intval($category->id), $product->name) : Tools::getFullPath(intval($product->id_default_category), smarty_modifier_truncate($product->name, 80))) )); Tu peux remplacer le 80 par n'importe quel nombre, cette fonction est sensée agir comme le truncate de smarty. Je n'ai pas testé le code alors dit moi si ça marche. Link to comment Share on other sites More sharing options...
BVince Posted August 6, 2010 Share Posted August 6, 2010 Bonjour,tu veux complètement enlever le nom du produit ou simplement le tronquer sur une certaine longueur ? Link to comment Share on other sites More sharing options...
ASBARRR Posted August 6, 2010 Author Share Posted August 6, 2010 BVince : Simplement le tronquer !amaury : Je teste de suite, merci. Link to comment Share on other sites More sharing options...
ASBARRR Posted August 6, 2010 Author Share Posted August 6, 2010 Merci pour ton aide amaury !Remplacer : $smarty->assign(array( 'return_link' => (isset($category->id) AND $category->id) ? Tools::safeOutput($link->getCategoryLink($category)) : '[removed] history.back();', 'path' => ((isset($category->id) AND $category->id) ? Tools::getFullPath(intval($category->id), $product->name) : Tools::getFullPath(intval($product->id_default_category), $product->name)) )); Par : $smarty->assign(array( 'return_link' => (isset($category->id) AND $category->id) ? Tools::safeOutput($link->getCategoryLink($category)) : '[removed] history.back();', 'path' => ((isset($category->id) AND $category->id) ? Tools::getFullPath(intval($category->id), smarty_modifier_truncate($product->name, 20)) : Tools::getFullPath(intval($product->id_default_category), smarty_modifier_truncate($product->name, 20))) )); J'ai remplacé les deux $product->name.Bonne journée ! Link to comment Share on other sites More sharing options...
amaury Posted August 6, 2010 Share Posted August 6, 2010 Pour info si ça marche, la fonction ressemble à ça : function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false, $charset = 'UTF-8') Pour plus d'options Link to comment Share on other sites More sharing options...
ASBARRR Posted August 6, 2010 Author Share Posted August 6, 2010 Ok ok merci pour tout ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now