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

#   Comportement de du bouton ajouter au panier

##

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

Less More

- Posts: 134
- Thank you received: 4
-
-

7 years 2 months ago [\#310797](#310797) by [clicetcom](/forum/user/9454-clicetcom "View clicetcom's Profile")  *[Comportement de du bouton ajouter au panier](/forum/5-support-en-francais-french-support-/898267-comportement-de-du-bouton-ajouter-au-panier#310797 "-- url of the page with the problem -- :   espacev2.clicetcom.fr/index.php?option=c...yout=show&amp;Itemid=110  -- HikaShop version -- : 4.2.1 -- Joomla version -- : 3.9.11 -- PHP version -- : 7.3  Bonjour,  Je rencontre un problème avec le bouton ajouter au panier quand sur la même pas page j'ai un produit et un produit associé.  Les deux boutons pointent vers le produit associé quand j'utilise le module hika&#95;content classique.  Du coup j'ai testé de faire un module personnalisé &quot;en dur&quot; avec un lien ajouter au panier contenant l'id du produit associé, mais ce dernier pointe vers le produit principal. Je dois passer a coté d'un truc... mais je vois pas.  Si quelqu'un a une idée ?")* was created by *[clicetcom](/forum/user/9454-clicetcom "View clicetcom's Profile")*

-- url of the page with the problem -- : [ espacev2.clicetcom.fr/index.php?option=c...yout=show&amp;Itemid=110](http://espacev2.clicetcom.fr/index.php?option=com_hikashop&view=product&layout=show&Itemid=110)
-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.11
-- PHP version -- : 7.3

Bonjour,

Je rencontre un problème avec le bouton ajouter au panier quand sur la même pas page j'ai un produit et un produit associé.

Les deux boutons pointent vers le produit associé quand j'utilise le module hika_content classique.

Du coup j'ai testé de faire un module personnalisé "en dur" avec un lien ajouter au panier contenant l'id du produit associé, mais ce dernier pointe vers le produit principal. Je dois passer a coté d'un truc... mais je vois pas.

Si quelqu'un a une idée ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk4MjY3LWNvbXBvcnRlbWVudC1kZS1kdS1ib3V0b24tYWpvdXRlci1hdS1wYW5pZXI/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 2 months ago [\#310801](#310801) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Comportement de du bouton ajouter au panier](/forum/5-support-en-francais-french-support-/898267-comportement-de-du-bouton-ajouter-au-panier#310801 "-- url of the page with the problem -- :   espacev2.clicetcom.fr/index.php?option=c...yout=show&amp;Itemid=110  -- HikaShop version -- : 4.2.1 -- Joomla version -- : 3.9.11 -- PHP version -- : 7.3  Bonjour,  Je rencontre un problème avec le bouton ajouter au panier quand sur la même pas page j'ai un produit et un produit associé.  Les deux boutons pointent vers le produit associé quand j'utilise le module hika&#95;content classique.  Du coup j'ai testé de faire un module personnalisé &quot;en dur&quot; avec un lien ajouter au panier contenant l'id du produit associé, mais ce dernier pointe vers le produit principal. Je dois passer a coté d'un truc... mais je vois pas.  Si quelqu'un a une idée ?")*

Bonjour,

Dans l'HTML du button du produit associé, vous avez le code:
data-addto-div="hikashop_product_form"
Cela indique au système d'ajout au panier de récupérer les informations du produit dans le formulaire avec le "name" "hikashop_product_form" pour faire l'ajout au panier. Or, c'est justement le name du formulaire de la page produit.
Pour que cela fonctionne correctement, il faire changer cet attribut de votre second bouton et entouré le bouton d'un form avec le nom correspondant à ce que vous mettrez dans cet attribut du button.

The following user(s) said Thank You: [clicetcom](/forum/user/9454-clicetcom "View clicetcom's Profile")

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

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

Less More

- Posts: 134
- Thank you received: 4
-
-

7 years 2 months ago [\#310899](#310899) by [clicetcom](/forum/user/9454-clicetcom "View clicetcom's Profile")  Replied by *[clicetcom](/forum/user/9454-clicetcom "View clicetcom's Profile")* on topic *[Comportement de du bouton ajouter au panier](/forum/5-support-en-francais-french-support-/898267-comportement-de-du-bouton-ajouter-au-panier#310899 "-- url of the page with the problem -- :   espacev2.clicetcom.fr/index.php?option=c...yout=show&amp;Itemid=110  -- HikaShop version -- : 4.2.1 -- Joomla version -- : 3.9.11 -- PHP version -- : 7.3  Bonjour,  Je rencontre un problème avec le bouton ajouter au panier quand sur la même pas page j'ai un produit et un produit associé.  Les deux boutons pointent vers le produit associé quand j'utilise le module hika&#95;content classique.  Du coup j'ai testé de faire un module personnalisé &quot;en dur&quot; avec un lien ajouter au panier contenant l'id du produit associé, mais ce dernier pointe vers le produit principal. Je dois passer a coté d'un truc... mais je vois pas.  Si quelqu'un a une idée ?")*

Merci Nicolas, explication limpide comme d'habitude !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk4MjY3LWNvbXBvcnRlbWVudC1kZS1kdS1ib3V0b24tYWpvdXRlci1hdS1wYW5pZXI/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.052 seconds

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