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

#   Adding to cart not working properly

##

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

Less More

- Posts: 26
- Thank you received: 1
-
-

10 years 1 week ago [\#255411](#255411) by [jannick](/forum/user/33157-jannick "View jannick's Profile")  *[Adding to cart not working properly](/forum/3-bug-report/887518-adding-to-cart-not-working-properly#255411 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6  Hi,  I thinks this is a bug however i'm not sure. The adding to cart functionality was working fine but now i have encountered a problem. When a product has multiple characteristics i can only add 1 product to my cart. If i select quantity 10, only 1 adds to the cart. When a product has one characteristic this is working fine. The products do not have any limits.  I there a setting that i have messed up? is this a bug? I'd like to know!  Thanks!")* was created by *[jannick](/forum/user/33157-jannick "View jannick's Profile")*

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.6

Hi,

I thinks this is a bug however i'm not sure. The adding to cart functionality was working fine but now i have encountered a problem. When a product has multiple characteristics i can only add 1 product to my cart. If i select quantity 10, only 1 adds to the cart. When a product has one characteristic this is working fine. The products do not have any limits.

I there a setting that i have messed up? is this a bug? I'd like to know!

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODc1MTgtYWRkaW5nLXRvLWNhcnQtbm90LXdvcmtpbmctcHJvcGVybHk/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: 86584
- Thank you received: 14325
-
-

10 years 1 week ago [\#255415](#255415) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding to cart not working properly](/forum/3-bug-report/887518-adding-to-cart-not-working-properly#255415 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6  Hi,  I thinks this is a bug however i'm not sure. The adding to cart functionality was working fine but now i have encountered a problem. When a product has multiple characteristics i can only add 1 product to my cart. If i select quantity 10, only 1 adds to the cart. When a product has one characteristic this is working fine. The products do not have any limits.  I there a setting that i have messed up? is this a bug? I'd like to know!  Thanks!")*

Hi,

It works fine on our end. Could you provide a link to the page with the issue ?

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

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

Less More

- Posts: 26
- Thank you received: 1
-
-

10 years 1 week ago -  10 years 1 week ago [\#255588](#255588) by [jannick](/forum/user/33157-jannick "View jannick's Profile")  Replied by *[jannick](/forum/user/33157-jannick "View jannick's Profile")* on topic *[Adding to cart not working properly](/forum/3-bug-report/887518-adding-to-cart-not-working-properly#255588 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6  Hi,  I thinks this is a bug however i'm not sure. The adding to cart functionality was working fine but now i have encountered a problem. When a product has multiple characteristics i can only add 1 product to my cart. If i select quantity 10, only 1 adds to the cart. When a product has one characteristic this is working fine. The products do not have any limits.  I there a setting that i have messed up? is this a bug? I'd like to know!  Thanks!")*

Hi,

This is the url of the demo server: [ www.slimbedacht.nu/bloomingnotes/index.php/webshop/diversen](http://www.slimbedacht.nu/bloomingnotes/index.php/webshop/diversen)

When i add less than 10, one product adds to the cart. When i select more than 10. 10 products add to the cart

When you look at this page you can see it works properly: [ www.slimbedacht.nu/bloomingnotes/index.php/webshop/product/test](http://www.slimbedacht.nu/bloomingnotes/index.php/webshop/product/test)

**Extra bug**

On this page: [ www.slimbedacht.nu/bloomingnotes/index.p...p/product/verjaardag](http://www.slimbedacht.nu/bloomingnotes/index.php/webshop/product/verjaardag) i have some extra characteristics active. This creates serveral problems. sometimes the characteristics are passed wrong to the checkout. In this demo the characteristics are not passed at all to the checkout.

Also the cart can't find the name in this situations. Error:

Notice: Undefined property: stdClass::$main_product_name in /public/sites/www.slimbedacht.nu/bloomingnotes/templates/bloomingnotes/html/com_hikashop/checkout/cart.php on line 128

Characterisics error:
Notice: Undefined property: stdClass::$characteristics in /public/sites/www.slimbedacht.nu/bloomingnotes/templates/bloomingnotes/html/com_hikashop/checkout/cart.php on line 210

I dit var_dump on the characteristics and the value is NULL.

I have already deleted all the products and characteristics but nothing helps.

Thanks!

Last edit: 10 years 1 week ago by [jannick](/forum/user/33157-jannick "View jannick's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODc1MTgtYWRkaW5nLXRvLWNhcnQtbm90LXdvcmtpbmctcHJvcGVybHk/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: 86584
- Thank you received: 14325
-
-

10 years 1 week ago [\#255596](#255596) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding to cart not working properly](/forum/3-bug-report/887518-adding-to-cart-not-working-properly#255596 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6  Hi,  I thinks this is a bug however i'm not sure. The adding to cart functionality was working fine but now i have encountered a problem. When a product has multiple characteristics i can only add 1 product to my cart. If i select quantity 10, only 1 adds to the cart. When a product has one characteristic this is working fine. The products do not have any limits.  I there a setting that i have messed up? is this a bug? I'd like to know!  Thanks!")*

Hi,

I suppose that the issue is with your template.
Rename the folder templates/YOUR_TEMPLATE/html/com_hikashop/product/ via FTP and you shouldn't have the problem.
If so, then try renaming each file in that folder until you find the one creating the problem.
Either keep it renamed if it isn't a problem for the product page display, or ask your template provider (or the designer who customized that view file on your end) to fix that view file.

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

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

Less More

- Posts: 26
- Thank you received: 1
-
-

10 years 1 week ago -  10 years 1 week ago [\#255652](#255652) by [jannick](/forum/user/33157-jannick "View jannick's Profile")  Replied by *[jannick](/forum/user/33157-jannick "View jannick's Profile")* on topic *[Adding to cart not working properly](/forum/3-bug-report/887518-adding-to-cart-not-working-properly#255652 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6  Hi,  I thinks this is a bug however i'm not sure. The adding to cart functionality was working fine but now i have encountered a problem. When a product has multiple characteristics i can only add 1 product to my cart. If i select quantity 10, only 1 adds to the cart. When a product has one characteristic this is working fine. The products do not have any limits.  I there a setting that i have messed up? is this a bug? I'd like to know!  Thanks!")*

Thanks for the Reply!

You were right(ofcorse) the problem is in a template file. The template contains the following file wich causes the error: hikashop_characteristics.php to override the characteristics table layout on the product page. The file contains the following code: Code:

&lt;?php function hikashop_characteristics_html(&amp;$element,&amp;$params, &amp;$obj){ if(empty($element-&gt;main-&gt;characteristics)) return ''; $obj-&gt;characteristics=&amp;$element-&gt;main-&gt;characteristics; foreach($obj-&gt;characteristics as $k =&gt; $characteristic){ if(empty($obj-&gt;characteristics[$k]-&gt;characteristic_display_method)){ $obj-&gt;characteristics[$k]-&gt;characteristic_display_method = $params-&gt;get('characteristic_display'); } } $obj-&gt;load(); if(empty($html)){ switch($params-&gt;get('characteristic_display')){ default: case 'radio': case 'dropdown': $main_html = '&lt;div class="hikashop_product_characteristics_table"&gt;'; $config =&amp; hikashop_config(); foreach($obj-&gt;characteristics as $characteristic){ $main_html.='&lt;div class="hikashop_characteristic_line_'.$characteristic-&gt;characteristic_id.'"&gt;'; $values = array(); $switch_done = false; if(!empty($characteristic-&gt;values)){ foreach($characteristic-&gt;values as $k =&gt; $value){ if(!$config-&gt;get('show_out_of_stock',1)){ $hasQuantity = false; foreach($element-&gt;variants as $variant){ foreach($variant-&gt;characteristics as $variantCharacteristic){ if($variantCharacteristic-&gt;characteristic_id==$value-&gt;characteristic_id){ if($variant-&gt;product_quantity != 0){ $hasQuantity = true; }elseif( $element-&gt;product_id==$variant-&gt;product_id &amp;&amp; !$switch_done){ if($characteristic-&gt;characteristic_display_method == 'dropdown'){ $id = 'hikashop_product_characteristic_'.$characteristic-&gt;characteristic_id; $js = "hikashopUpdateVariant(document.getElementById('".$id."'));"; }else{ $id = 'hikashop_product_characteristic['.$characteristic-&gt;characteristic_id.']'; $js = "var el = document.querySelector('[name=\"".$id."\"]'); if(el) el.checked = true; hikashopUpdateVariant(el);"; } $js = " window.hikashop.ready( function() {".$js."});"; if (!HIKASHOP_PHP5) { $doc =&amp; JFactory::getDocument(); }else{ $doc = JFactory::getDocument(); } $doc-&gt;addScriptDeclaration("\n&lt;!--\n".$js."\n//--&gt;\n"); $switch_done = true; } } } } if(!$hasQuantity) continue; } $values[$k]=$value-&gt;characteristic_value; } } $html=$obj-&gt;display(@$characteristic-&gt;characteristic_id,@$characteristic-&gt;default-&gt;characteristic_id,$values,$characteristic-&gt;characteristic_display_method); if($params-&gt;get('characteristic_display_text') &amp;&amp; isset($characteristic-&gt;characteristic_value)){ $html=$characteristic-&gt;characteristic_value.'&lt;/div&gt;&lt;div class="col-md-9"&gt;'.$html; } $main_html.='&lt;div class="row"&gt;&lt;div class="col-md-3"&gt;'.$html.'&lt;/div&gt;&lt;/div&gt;'; } $main_html.='&lt;/div&gt;&lt;/div&gt;'; $html = $main_html; break; } } $html.=' &lt;noscript&gt; &lt;input type="submit" class="btn button" name="characteristic" value="'.JText::_('REFRESH_INFORMATION').'"/&gt; &lt;/noscript&gt;'; return $html; }

I have followed another topic wich said: create this function, paste the core code in the function and replace $this with $obj. Could you tell the problem with this code?

Thanks in advance!

Last edit: 10 years 1 week ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: [code] is nice !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODc1MTgtYWRkaW5nLXRvLWNhcnQtbm90LXdvcmtpbmctcHJvcGVybHk/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: 86584
- Thank you received: 14325
-
-

10 years 1 week ago [\#255660](#255660) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding to cart not working properly](/forum/3-bug-report/887518-adding-to-cart-not-working-properly#255660 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6  Hi,  I thinks this is a bug however i'm not sure. The adding to cart functionality was working fine but now i have encountered a problem. When a product has multiple characteristics i can only add 1 product to my cart. If i select quantity 10, only 1 adds to the cart. When a product has one characteristic this is working fine. The products do not have any limits.  I there a setting that i have messed up? is this a bug? I'd like to know!  Thanks!")*

Hi,

Well, try changing the line:
return $html;
to:
return $html.'&lt;/div&gt;';

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

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

Less More

- Posts: 26
- Thank you received: 1
-
-

10 years 5 days ago [\#255771](#255771) by [jannick](/forum/user/33157-jannick "View jannick's Profile")  Replied by *[jannick](/forum/user/33157-jannick "View jannick's Profile")* on topic *[Adding to cart not working properly](/forum/3-bug-report/887518-adding-to-cart-not-working-properly#255771 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6  Hi,  I thinks this is a bug however i'm not sure. The adding to cart functionality was working fine but now i have encountered a problem. When a product has multiple characteristics i can only add 1 product to my cart. If i select quantity 10, only 1 adds to the cart. When a product has one characteristic this is working fine. The products do not have any limits.  I there a setting that i have messed up? is this a bug? I'd like to know!  Thanks!")*

I thought the problem would something more than just a closing div tag. The problem was in the following line: $main_html.='&lt;div class="row"&gt;&lt;div class="col-md-3"&gt;'.$html.'&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;';

Thanks!!

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

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