[Skip to main content](#vessel-content)

#   Titre champs perso dans listing produit

##

- **[kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")**
- [![kiweerouge's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3764-kiweerouge "View kiweerouge's Profile") Topic Author
- [ Offline](/forum/user/3764-kiweerouge)

Less More

- Posts: 101
- Thank you received: 4
-
-

13 years 5 months ago [\#102659](#102659) by [kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")  *[Titre champs perso dans listing produit](/forum/2-general-talk-about-hikashop/81468-titre-champs-perso-dans-listing-produit#102659 "Bonjour,  Je voudrais afficher le titre des champs pero dans le listing des produits, mais je ne vois pas comment faire.  J'ai bien $this-&gt;row-&gt;nom&#95;du&#95;champs qui m'affiche la valeur, mais je voudrais afficher le titre. Je n'ai pas trouvé le titre dans $this-&gt;row  Une idée ?  Merci d'avance !")* was created by *[kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")*

Bonjour,

Je voudrais afficher le titre des champs pero dans le listing des produits, mais je ne vois pas comment faire.

J'ai bien $this-&gt;row-&gt;nom_du_champs qui m'affiche la valeur, mais je voudrais afficher le titre. Je n'ai pas trouvé le titre dans $this-&gt;row

Une idée ?

Merci d'avance !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxNDY4LXRpdHJlLWNoYW1wcy1wZXJzby1kYW5zLWxpc3RpbmctcHJvZHVpdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 5 months ago [\#102689](#102689) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Titre champs perso dans listing produit](/forum/2-general-talk-about-hikashop/81468-titre-champs-perso-dans-listing-produit#102689 "Bonjour,  Je voudrais afficher le titre des champs pero dans le listing des produits, mais je ne vois pas comment faire.  J'ai bien $this-&gt;row-&gt;nom&#95;du&#95;champs qui m'affiche la valeur, mais je voudrais afficher le titre. Je n'ai pas trouvé le titre dans $this-&gt;row  Une idée ?  Merci d'avance !")*

Bonjour,

Si vous utilisez le nom du champ pour afficher la valeur, pourquoi ne pas mettre en dur le nom dans le titre ?
Ce dernier ne changera pas, et si il change il faudra dans tous les cas éditer cette vue.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxNDY4LXRpdHJlLWNoYW1wcy1wZXJzby1kYW5zLWxpc3RpbmctcHJvZHVpdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")**
- [![kiweerouge's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3764-kiweerouge "View kiweerouge's Profile") Topic Author
- [ Offline](/forum/user/3764-kiweerouge)

Less More

- Posts: 101
- Thank you received: 4
-
-

13 years 5 months ago [\#103810](#103810) by [kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")  Replied by *[kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")* on topic *[Titre champs perso dans listing produit](/forum/2-general-talk-about-hikashop/81468-titre-champs-perso-dans-listing-produit#103810 "Bonjour,  Je voudrais afficher le titre des champs pero dans le listing des produits, mais je ne vois pas comment faire.  J'ai bien $this-&gt;row-&gt;nom&#95;du&#95;champs qui m'affiche la valeur, mais je voudrais afficher le titre. Je n'ai pas trouvé le titre dans $this-&gt;row  Une idée ?  Merci d'avance !")*

euh... désolé je suis pas sure d'avoir compris.

J'ai un champs personnalisé avec une liste déroulante;
valeur -&gt; titre
vin_rose -&gt; Vin Rose
vin_rouge -&gt; Vin Rouge

Dans mon listing j'arrive à afficher la valeur (donc vin_rose) mais je voudrais le titre (Vin Rose).

Je sais que je pourrais mettre comme valeur "Vin Rose" mais j'utilise les valeurs dans les paramètres des URLs, du coup c'est pas très propre ![:/](/irritated.gif ":/")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxNDY4LXRpdHJlLWNoYW1wcy1wZXJzby1kYW5zLWxpc3RpbmctcHJvZHVpdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 5 months ago [\#103831](#103831) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Titre champs perso dans listing produit](/forum/2-general-talk-about-hikashop/81468-titre-champs-perso-dans-listing-produit#103831 "Bonjour,  Je voudrais afficher le titre des champs pero dans le listing des produits, mais je ne vois pas comment faire.  J'ai bien $this-&gt;row-&gt;nom&#95;du&#95;champs qui m'affiche la valeur, mais je voudrais afficher le titre. Je n'ai pas trouvé le titre dans $this-&gt;row  Une idée ?  Merci d'avance !")*

Bonjour,

Le champs personnalisé sauvegarde la valeur dans la base, c'est donc cette valeur qui peut être lu.
Afin d'afficher le titre, il faut au préalable charger la configuration des champs personnalisés, pour récupérer la liste de correspondance "valeur &lt;=&gt; titre" et ainsi afficher le titre de la valeur en base.

C'est ce qui est fait dans la vue "product &#124; show_block_custom_main". La vue parcours tous les champs personnalisés et les affiches via la fonction Code:

echo $this-&gt;fieldsClass-&gt;show($oneExtraField,$value);

Mais pour cela, il lui faut l'objet $oneExtraField qui contient la configuration de votre champs personnalisé.

Dans le listing des produits, la class field est chargée également mais les custom field ne sont chargés que si le listing n'est pas affiché en module.
Si l'affichage est fait dans un module, il faudra donc les charger.

Ensuite dans votre listing, vous pouvez utiliser le code de la vue "product &#124; show_block_custom_main" afin de faire le parcours des champs personnalisés et n'afficher que les champs qui vous intéresse en fonction de leur $fieldName.

Cordialement,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxNDY4LXRpdHJlLWNoYW1wcy1wZXJzby1kYW5zLWxpc3RpbmctcHJvZHVpdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")**
- [![kiweerouge's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3764-kiweerouge "View kiweerouge's Profile") Topic Author
- [ Offline](/forum/user/3764-kiweerouge)

Less More

- Posts: 101
- Thank you received: 4
-
-

13 years 5 months ago -  13 years 5 months ago [\#104098](#104098) by [kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")  Replied by *[kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")* on topic *[Titre champs perso dans listing produit](/forum/2-general-talk-about-hikashop/81468-titre-champs-perso-dans-listing-produit#104098 "Bonjour,  Je voudrais afficher le titre des champs pero dans le listing des produits, mais je ne vois pas comment faire.  J'ai bien $this-&gt;row-&gt;nom&#95;du&#95;champs qui m'affiche la valeur, mais je voudrais afficher le titre. Je n'ai pas trouvé le titre dans $this-&gt;row  Une idée ?  Merci d'avance !")*

ok c'est un peu plus clair.

Mais du coup comment charger la config des champs perso ? Parce que là même mon listing n'est pas dans un module le titre du champs n'est pas récupéré.

Last edit: 13 years 5 months ago by [kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxNDY4LXRpdHJlLWNoYW1wcy1wZXJzby1kYW5zLWxpc3RpbmctcHJvZHVpdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14278
-
-

13 years 5 months ago [\#104121](#104121) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Titre champs perso dans listing produit](/forum/2-general-talk-about-hikashop/81468-titre-champs-perso-dans-listing-produit#104121 "Bonjour,  Je voudrais afficher le titre des champs pero dans le listing des produits, mais je ne vois pas comment faire.  J'ai bien $this-&gt;row-&gt;nom&#95;du&#95;champs qui m'affiche la valeur, mais je voudrais afficher le titre. Je n'ai pas trouvé le titre dans $this-&gt;row  Une idée ?  Merci d'avance !")*

Vous pouvez charger les fields pour un produit comme ceci: Code:

$itemFields = $this-&gt;fieldsClass-&gt;getFields('frontcomp',$this-&gt;row,'product','checkout&amp;task=state');

Et pour l'affichage: Code:

foreach($itemFields as $fieldName =&gt; $oneExtraField) { if(!isset($this-&gt;row-&gt;$fieldName)) continue; echo $this-&gt;fieldsClass-&gt;show($oneExtraField,trim($this-&gt;row-&gt;$fieldName)); }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxNDY4LXRpdHJlLWNoYW1wcy1wZXJzby1kYW5zLWxpc3RpbmctcHJvZHVpdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")**
- [![kiweerouge's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3764-kiweerouge "View kiweerouge's Profile") Topic Author
- [ Offline](/forum/user/3764-kiweerouge)

Less More

- Posts: 101
- Thank you received: 4
-
-

13 years 5 months ago [\#105772](#105772) by [kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")  Replied by *[kiweerouge](/forum/user/3764-kiweerouge "View kiweerouge's Profile")* on topic *[Titre champs perso dans listing produit](/forum/2-general-talk-about-hikashop/81468-titre-champs-perso-dans-listing-produit#105772 "Bonjour,  Je voudrais afficher le titre des champs pero dans le listing des produits, mais je ne vois pas comment faire.  J'ai bien $this-&gt;row-&gt;nom&#95;du&#95;champs qui m'affiche la valeur, mais je voudrais afficher le titre. Je n'ai pas trouvé le titre dans $this-&gt;row  Une idée ?  Merci d'avance !")*

Bon finalement j'ai eu un peu de mal avec ce code, alors comme de toute manière je doit de base modifier quelque chose dans le code lorsque j'ajoute une nouvelle valeur à ce champs personnalisé, j'ai fait un tableau avec valeur / titre, et j'affiche le bon titre en fonction de la valeur.

Pas forcément optimale comme méthode mais ça fonctionne.

Merci !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxNDY4LXRpdHJlLWNoYW1wcy1wZXJzby1kYW5zLWxpc3RpbmctcHJvZHVpdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.077 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
