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

#   characteristics not processed when added to cart

##

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

Less More

- Posts: 73
- Thank you received: 1
-
-

13 years 2 months ago [\#121519](#121519) by [Ortix](/forum/user/12608-ortix "View Ortix's Profile")  *[characteristics not processed when added to cart](/forum/31-development/861617-characteristics-not-processed-when-added-to-cart#121519 "-- url of the page with the problem -- :   exo-l.com/shop2/exo-l  -- HikaShop version -- : 1.6 -- Joomla version -- : 2.5 -- PHP version -- : 5.3.3 -- Browser(s) name and version -- : Firefox 25 or something  If you take a look at my page you see that I have two products on a single page. Everything works great except for the fact that the characteristics of the &quot;rechts&quot; (right) product are not processed when added to the cart. The product always has the same characteristics but the extra field &quot;gravure&quot; does work.  I'm curious where I could be going wrong. I checked the &quot;hikashopUpdateVariant&quot; and all the characteristics are grabbed correctly.  What is the line of processing so I can debug every step and see where the problem lies? As in, when I click the add to cart button, how can I see where/why my characteristic is not added to the product in the cart.")* was created by *[Ortix](/forum/user/12608-ortix "View Ortix's Profile")*

-- url of the page with the problem -- : [ exo-l.com/shop2/exo-l](http://exo-l.com/shop2/exo-l)
-- HikaShop version -- : 1.6
-- Joomla version -- : 2.5
-- PHP version -- : 5.3.3
-- Browser(s) name and version -- : Firefox 25 or something

If you take a look at my page you see that I have two products on a single page. Everything works great except for the fact that the characteristics of the "rechts" (right) product are not processed when added to the cart. The product always has the same characteristics but the extra field "gravure" does work.

I'm curious where I could be going wrong. I checked the "hikashopUpdateVariant" and all the characteristics are grabbed correctly.

What is the line of processing so I can debug every step and see where the problem lies? As in, when I click the add to cart button, how can I see where/why my characteristic is not added to the product in the cart.

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

Less More

- Posts: 86541
- Thank you received: 14304
-
-

13 years 2 months ago [\#121570](#121570) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[characteristics not processed when added to cart](/forum/31-development/861617-characteristics-not-processed-when-added-to-cart#121570 "-- url of the page with the problem -- :   exo-l.com/shop2/exo-l  -- HikaShop version -- : 1.6 -- Joomla version -- : 2.5 -- PHP version -- : 5.3.3 -- Browser(s) name and version -- : Firefox 25 or something  If you take a look at my page you see that I have two products on a single page. Everything works great except for the fact that the characteristics of the &quot;rechts&quot; (right) product are not processed when added to the cart. The product always has the same characteristics but the extra field &quot;gravure&quot; does work.  I'm curious where I could be going wrong. I checked the &quot;hikashopUpdateVariant&quot; and all the characteristics are grabbed correctly.  What is the line of processing so I can debug every step and see where the problem lies? As in, when I click the add to cart button, how can I see where/why my characteristic is not added to the product in the cart.")*

Hi,

When you click on the add to cart button, it submits the form of the button. Inside it, there is the hidden input with the id hikashop_product_id_main which contains the product id or current variant id if your product has a characteristic.
Your issue is that you have twice that hidden input field on your page (one for each product form) and when you select another characteristic variant for a product, the javascript replaces the id in that hidden input using its id, but since the id is not unique on the page, it's not replacing the correct one and you don't get the id of the variant updated. Which means that you always get the default variant added in the cart in that case.
The solution is to change the javascript function which handle the copying of the id (and the other product data) when you select another characteristic variant so that it copy the data in the correct elements.
That's done by the hikashopUpdateVariant javascripti function call of your color selectors and you will find the JS code of that function in the file administrator/components/com_hikashop/types/characteristic.php

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

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

Less More

- Posts: 73
- Thank you received: 1
-
-

13 years 2 months ago [\#121764](#121764) by [Ortix](/forum/user/12608-ortix "View Ortix's Profile")  Replied by *[Ortix](/forum/user/12608-ortix "View Ortix's Profile")* on topic *[characteristics not processed when added to cart](/forum/31-development/861617-characteristics-not-processed-when-added-to-cart#121764 "-- url of the page with the problem -- :   exo-l.com/shop2/exo-l  -- HikaShop version -- : 1.6 -- Joomla version -- : 2.5 -- PHP version -- : 5.3.3 -- Browser(s) name and version -- : Firefox 25 or something  If you take a look at my page you see that I have two products on a single page. Everything works great except for the fact that the characteristics of the &quot;rechts&quot; (right) product are not processed when added to the cart. The product always has the same characteristics but the extra field &quot;gravure&quot; does work.  I'm curious where I could be going wrong. I checked the &quot;hikashopUpdateVariant&quot; and all the characteristics are grabbed correctly.  What is the line of processing so I can debug every step and see where the problem lies? As in, when I click the add to cart button, how can I see where/why my characteristic is not added to the product in the cart.")*

which line copies the correct characteristic id to that hidden field? Because I can grab the right "selection" variable. That one is correct.
But apparently the default value is still being submitted. This means that the selection which I grab correctly is not copied into the hidden field of the "right" product. It's in the "left" product. Where is this copying happening? In hikashopUpdateVariantData?
The selection variable arrives correctly there.

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

Less More

- Posts: 86541
- Thank you received: 14304
-
-

13 years 2 months ago [\#121772](#121772) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[characteristics not processed when added to cart](/forum/31-development/861617-characteristics-not-processed-when-added-to-cart#121772 "-- url of the page with the problem -- :   exo-l.com/shop2/exo-l  -- HikaShop version -- : 1.6 -- Joomla version -- : 2.5 -- PHP version -- : 5.3.3 -- Browser(s) name and version -- : Firefox 25 or something  If you take a look at my page you see that I have two products on a single page. Everything works great except for the fact that the characteristics of the &quot;rechts&quot; (right) product are not processed when added to the cart. The product always has the same characteristics but the extra field &quot;gravure&quot; does work.  I'm curious where I could be going wrong. I checked the &quot;hikashopUpdateVariant&quot; and all the characteristics are grabbed correctly.  What is the line of processing so I can debug every step and see where the problem lies? As in, when I click the add to cart button, how can I see where/why my characteristic is not added to the product in the cart.")*

Yes.
As I said, the issue is that the two hidden input fields for the product_id have the same HTML id. So the hikashopUpdateVariantData always copy the data in the first product hidden input.

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

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