3r1c Posted March 1, 2016 Share Posted March 1, 2016 Bonjour, J'aimerai afficher la description des produits juste en bas des noms et je sollicite votre aide pour le faire. Je suis sur la version 1.6 de Prestashop et j'utilise le thème par défaut "default-bootstrap". Link to comment Share on other sites More sharing options...
Alexandre Carette Posted March 1, 2016 Share Posted March 1, 2016 (edited) Bonjour, dans le tpl product-list.tpl essaye {$product.description|escape:html:'UTF-8'} Edited March 1, 2016 by Alex-Kodd (see edit history) Link to comment Share on other sites More sharing options...
3r1c Posted March 1, 2016 Author Share Posted March 1, 2016 Effectivement les descriptions s'affichent mais par contre je voudrais que ce soit la description courte. C'est quoi le code? Link to comment Share on other sites More sharing options...
Alexandre Carette Posted March 1, 2016 Share Posted March 1, 2016 {$product.description_short|escape:html:'UTF-8'} Link to comment Share on other sites More sharing options...
3r1c Posted March 1, 2016 Author Share Posted March 1, 2016 (edited) Avant que j'ajoute le code que code que vous suggérez (qui en passant affiche bien la courte description sauf que les balises <p> et </p> s'affichent eux aussi) le code ci-dessous s'affichent mais grisé dans firebug. <p class="product-desc" itemprop="description"> Robe de soirée imprimée à manches droites et volants, avec fine ceinture noire à la taille. </p> Voici le code dans product-list.tpl <div class="right-block"> <h5 itemprop="name"> {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if} <a class="product-name" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" > {$product.name|truncate:45:'...'|escape:'html':'UTF-8'} </a> </h5> {capture name='displayProductListReviews'}{hook h='displayProductListReviews' product=$product}{/capture} {if $smarty.capture.displayProductListReviews} <div class="hook-reviews"> {hook h='displayProductListReviews' product=$product} </div> {/if} <p class="product-desc" itemprop="description"> {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} </p> La description est donc déjà la dedans mais comment l'afficher. Edited March 1, 2016 by 3r1c (see edit history) Link to comment Share on other sites More sharing options...
3r1c Posted March 1, 2016 Author Share Posted March 1, 2016 Ok ça marche j'ai juste enlevé la classe "product-desc". merci 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