Skip to main content

afficher le nom de la catégorie dans fiche produit

More
14 years 2 months ago #59063 by tataye
bonjour

je cherche à appeler le nom de la catégorie du produit dans la fiche produit (question de référencement)
or, quand je mets :
Code:
<h1><div id="cat"> <?php echo $this->element->category_name; ?> </div></h1>
cela ne fonctionne pas
(je suis dans products /show)

cela fonctionne quand je suis dans listing

dans show, j'arrive à afficher la div, mais elle ne va pas chercher le nom de la cat dans la BDD

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #59073 by Eliot
Bonjour,

Voilà le code pour afficher les catégories avant le nom du produit:
Code:
foreach($this->categories as $category){ echo ($category->category_name).' - '; }

Cela affiche le nom de toutes les catégories liées au produit. Vous pouvez changer la mise en forme en modifiant la partie entre guillemets.
The following user(s) said Thank You: tataye

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #59111 by tataye
ça marche impeccable, merci

Please Log in or Create an account to join the conversation.

Time to create page: 0.220 seconds
Powered by Kunena Forum