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

#   Affichage champs personnalisé dans panier

##

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

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 4 months ago [\#242757](#242757) by [AntinJH](/forum/user/39561-antinjh "View AntinJH's Profile")  *[Affichage champs personnalisé dans panier](/forum/5-support-en-francais-french-support-/885025-affichage-champs-personnalise-dans-panier#242757 "-- url of the page with the problem -- :   antin.jonchere.fr/index.php/  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1  Bonjour,  J'ai développé un panier un peu particulier, il s'agit d'un camion qui se remplit au fur et à mesure que le client y ajoute des produits. Tout fonctionne parfaitement sauf un champs personnalisé dans lequel je spécifie le type de conditionnement (soit /m², soit /unité). L'idée est simplement d'indiquer la quantité comme ceci : &quot;200 m²&quot; ou &quot;200 unité&quot; en fonction du produit.  L'erreur est très étrange, car mon code fonctionne pour tous les produits du panier, sauf le premier ! Plus étrange encore, j'ai utilisé exactement le même code pour le checkout, et cela fonctionne parfaitement... Et si je fais un tour par le checkout et que je reviens au camion, alors tout fonctionne parfaitement !!  Je penche du côté de la mise à jour Ajax, mais là j'avoue que je sèche... Auriez-vous une idée ?  Merci !")* was created by *[AntinJH](/forum/user/39561-antinjh "View AntinJH's Profile")*

-- url of the page with the problem -- : [ antin.jonchere.fr/index.php/](http://antin.jonchere.fr/index.php/)
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1

Bonjour,

J'ai développé un panier un peu particulier, il s'agit d'un camion qui se remplit au fur et à mesure que le client y ajoute des produits. Tout fonctionne parfaitement sauf un champs personnalisé dans lequel je spécifie le type de conditionnement (soit /m², soit /unité). L'idée est simplement d'indiquer la quantité comme ceci : "200 m²" ou "200 unité" en fonction du produit.
Code:

&lt;input id="hikashop_cart_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;" type="text" name="item[&lt;?php echo $row-&gt;cart_product_id;?&gt;][cart_product_quantity]" class="hikashop_product_quantity_field" style="width:35px !important;" value="&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;" onchange="var qty_field = document.getElementById('hikashop_cart_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field){&lt;?php echo $input; ?&gt; } document.&lt;?php echo $form; ?&gt;.submit(); return false;" /&gt; &lt;?php // AFFICHAGE DE L'UNITÉ $unite = substr($this-&gt;row-&gt;unitprice,2,strlen($this-&gt;row-&gt;unitprice)); echo ' '.$unite; ?&gt;

L'erreur est très étrange, car mon code fonctionne pour tous les produits du panier, sauf le premier ! Plus étrange encore, j'ai utilisé exactement le même code pour le checkout, et cela fonctionne parfaitement... Et si je fais un tour par le checkout et que je reviens au camion, alors tout fonctionne parfaitement !!

[img size=600px][ antin.jonchere.fr/unitecamion.jpg](http://antin.jonchere.fr/unitecamion.jpg)[/img]

Je penche du côté de la mise à jour Ajax, mais là j'avoue que je sèche...
Auriez-vous une idée ?

Merci !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODg1MDI1LWFmZmljaGFnZS1jaGFtcHMtcGVyc29ubmFsaXNlLWRhbnMtcGFuaWVyP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14267
-
-

10 years 4 months ago [\#242780](#242780) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Affichage champs personnalisé dans panier](/forum/5-support-en-francais-french-support-/885025-affichage-champs-personnalise-dans-panier#242780 "-- url of the page with the problem -- :   antin.jonchere.fr/index.php/  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1  Bonjour,  J'ai développé un panier un peu particulier, il s'agit d'un camion qui se remplit au fur et à mesure que le client y ajoute des produits. Tout fonctionne parfaitement sauf un champs personnalisé dans lequel je spécifie le type de conditionnement (soit /m², soit /unité). L'idée est simplement d'indiquer la quantité comme ceci : &quot;200 m²&quot; ou &quot;200 unité&quot; en fonction du produit.  L'erreur est très étrange, car mon code fonctionne pour tous les produits du panier, sauf le premier ! Plus étrange encore, j'ai utilisé exactement le même code pour le checkout, et cela fonctionne parfaitement... Et si je fais un tour par le checkout et que je reviens au camion, alors tout fonctionne parfaitement !!  Je penche du côté de la mise à jour Ajax, mais là j'avoue que je sèche... Auriez-vous une idée ?  Merci !")*

Bonjour,

Le problème est que vous utilisez $this-&gt;row au lieu de $row pour l'affichage de l'unité.

The following user(s) said Thank You: [AntinJH](/forum/user/39561-antinjh "View AntinJH's Profile")

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

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

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 4 months ago [\#242800](#242800) by [AntinJH](/forum/user/39561-antinjh "View AntinJH's Profile")  Replied by *[AntinJH](/forum/user/39561-antinjh "View AntinJH's Profile")* on topic *[Affichage champs personnalisé dans panier](/forum/5-support-en-francais-french-support-/885025-affichage-champs-personnalise-dans-panier#242800 "-- url of the page with the problem -- :   antin.jonchere.fr/index.php/  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1  Bonjour,  J'ai développé un panier un peu particulier, il s'agit d'un camion qui se remplit au fur et à mesure que le client y ajoute des produits. Tout fonctionne parfaitement sauf un champs personnalisé dans lequel je spécifie le type de conditionnement (soit /m², soit /unité). L'idée est simplement d'indiquer la quantité comme ceci : &quot;200 m²&quot; ou &quot;200 unité&quot; en fonction du produit.  L'erreur est très étrange, car mon code fonctionne pour tous les produits du panier, sauf le premier ! Plus étrange encore, j'ai utilisé exactement le même code pour le checkout, et cela fonctionne parfaitement... Et si je fais un tour par le checkout et que je reviens au camion, alors tout fonctionne parfaitement !!  Je penche du côté de la mise à jour Ajax, mais là j'avoue que je sèche... Auriez-vous une idée ?  Merci !")*

Parfait, merci !!

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

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

[](#top)
