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

#   Plusieurs choix possible pour une option ?

##

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 11 months ago [\#301851](#301851) by Laurentfrom47  *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#301851 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")* was created by *Laurentfrom47*

-- HikaShop version -- : 4.0.1 business
-- Joomla version -- : 3.9
-- PHP version -- : 7.3

Bonsoir,

Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?

Je vous remercie.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk2NTA4LXBsdXNpZXVycy1jaG9peC1wb3NzaWJsZS1wb3VyLXVuZS1vcHRpb24/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

7 years 11 months ago [\#301867](#301867) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#301867 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")*

Bonjour,

Vous pourriez créer un champs personnalisé de la table "article" pour la sélection de la couleur de cadre.
Après, ce champs sera afficher tout le temps, même sur l'option n'est pas sélectionnée, mais vous pouvez aussi rajouter un peu de javascript à la page pour afficher/cacher la zone du champs personnalisé en fonction de l'option.
Par exemple:
[ stackoverflow.com/questions/18421082/sho...if-checkbox-selected](https://stackoverflow.com/questions/18421082/show-hide-div-if-checkbox-selected)

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 11 months ago [\#301881](#301881) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#301881 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")*

Bonjour,

ah oui super, pour placer ce champ dans la partie option quel code il faut, j'ai essayé avec celui là mais ça marche pas :
&lt;?php echo $this-&gt;element-&gt;couleursdecadre; ?&gt;

Merci beaucoup.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk2NTA4LXBsdXNpZXVycy1jaG9peC1wb3NzaWJsZS1wb3VyLXVuZS1vcHRpb24/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

7 years 11 months ago [\#301883](#301883) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#301883 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")*

Bonjour,

Ce code permet juste d'afficher la valeur d'un champs de la table "produit". Donc rien à voir avec ce que vous voulez faire.
Afficher l'interface d'édition du champs est bien plus compliqué.
Vous trouverez le code qui fait ça dans le fichier show_block_custom_item via le menu Affichage&gt;vues.

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 11 months ago [\#301896](#301896) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#301896 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")*

Ok, ce que j'ai fait, j'ai mis le code du template show_block_custom_item.php là ou je voulais, c'est celui ci : Code:

&lt;table class="hikashop_product_custom_item_info_table"&gt; &lt;?php foreach ($this-&gt;itemFields as $fieldName =&gt; $oneExtraField) { if(empty($this-&gt;element-&gt;$fieldName)) $this-&gt;element-&gt;$fieldName = $oneExtraField-&gt;field_default; $itemData = hikaInput::get()-&gt;getString('item_data_' . $fieldName, $this-&gt;element-&gt;$fieldName); ?&gt; &lt;tr id="hikashop_item_&lt;?php echo $oneExtraField-&gt;field_namekey; ?&gt;" class="hikashop_item_&lt;?php echo $oneExtraField-&gt;field_namekey;?&gt;_line"&gt; &lt;td class="key"&gt; &lt;span id="hikashop_product_custom_item_name_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_item_name"&gt;&lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField); ?&gt;&lt;/span&gt; &lt;/td&gt; &lt;td&gt; &lt;span id="hikashop_product_custom_item_value_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_item_value"&gt;&lt;?php $onWhat='onchange'; if($oneExtraField-&gt;field_type=='radio') $onWhat='onclick'; $oneExtraField-&gt;product_id = $this-&gt;element-&gt;product_id; echo $this-&gt;fieldsClass-&gt;display( $oneExtraField, $itemData, 'data[item]['.$oneExtraField-&gt;field_namekey.']', false, ' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'item\',0);"' ); ?&gt;&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; &lt;/table&gt;

Par contre, cela affiche tous les champs article et ça ne s'affiche que si je mets l'affichage sur oui pour la partie publique.
Comment pourrais je faire afficher un champ spécifique même si l'affichage est sur non ?

Je vous remercie.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk2NTA4LXBsdXNpZXVycy1jaG9peC1wb3NzaWJsZS1wb3VyLXVuZS1vcHRpb24/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

7 years 11 months ago [\#301918](#301918) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#301918 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")*

Bonjour,

Pour n'afficher qu'un champs, vous pouvez rajouter une ligne de ce genre:
if($fieldName != 'XXX') continue;
après la ligne:
foreach ($this-&gt;itemFields as $fieldName =&gt; $oneExtraField) {
de ce code.
Je ne vois pas l'intérêt de vouloir quand même afficher le champs malgré l'option d'affichage désactivé ?
Si c'est pour ne pas avoir l'affichage à la position normale, alors il suffit de rajouter une ligne:
return;
au début du fichier show_block_custom_item.
Sinon, si vraiment vous voulez faire cela, cela implique de charger vous-même les données du champs personnalisé de la table hikashop_field avec une requête MySQL pour ensuite pouvoir utiliser ces données pour l'affichage, donc c'est plus compliqué que juste du copier/coller...

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 11 months ago [\#301928](#301928) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#301928 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")*

Bonjour,

Oui ok, merci beaucoup.

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 10 months ago [\#302118](#302118) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#302118 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")*

Bonjour,

J'ai donc créé un champ de type item pour faire un sélecteur de couleur que j'affiche uniquement quand l'option est sélectionnée, cela fonctionne bien mais dans la commande il s'affiche dans la ligne du produit c'est certainement normal et logique mais existerait-il un moyen pour qu'il s'affiche dans la ligne couleur de cadre [ i.imgur.com/FnRYBrM.jpg](https://i.imgur.com/FnRYBrM.jpg) ?

Je vous remercie.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk2NTA4LXBsdXNpZXVycy1jaG9peC1wb3NzaWJsZS1wb3VyLXVuZS1vcHRpb24/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

7 years 10 months ago [\#302119](#302119) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#302119 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")*

Bonjour,

Ce n'est pas tant cela le soucis. Normalement l'option devrait être groupée avec le produit correspondant. Sinon, imaginez que la personne ajoute au panier deux vélos, vous ne saurez pas pour quel produit est l'option.
Cela peut être ok de découpler les produits et les options dans certaines boutique, mais pour votre cas, je ne pense pas que cela soit judicieux.
Et donc, je vous recommande d'activer l'option "Grouper les options avec les produits" de la configuration HikaShop. Ainsi, et l'option et la couleur seront ensemble avec le produit lui-même, ce qui me semble bien plus logique.

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 10 months ago [\#302140](#302140) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Plusieurs choix possible pour une option ?](/forum/5-support-en-francais-french-support-/896508-plusieurs-choix-possible-pour-une-option#302140 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : 3.9 -- PHP version -- : 7.3  Bonsoir,  Pour ce site (voir URL) à l'option couleur de cadre en fait il existe bien sur plusieurs couleurs possibles, comment pourrais-je faire cela, il n'est pas possible d'ajouter dans l'option plusieurs choix possible ? un select en dessous ? ou un autre manière ?  Je vous remercie.")*

Bonjour Nicolas,

Mais c'est parfait ça!

Un grand merci.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk2NTA4LXBsdXNpZXVycy1jaG9peC1wb3NzaWJsZS1wb3VyLXVuZS1vcHRpb24/dG1wbD1tYXJrZG93bg==) 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.060 seconds

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