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

#   Impossible to add a product to the cart if quantity is the same

##

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

Less More

- Posts: 33
- Thank you received: 2
-
-

4 years 7 months ago [\#340456](#340456) by [softdune](/forum/user/58135-softdune "View softdune's Profile")  *[Impossible to add a product to the cart if quantity is the same](/forum/35-orders-management/904182-impossible-to-add-a-product-to-the-cart-if-quantity-is-the-same#340456 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28  In previous version of Hikashop a user could 'add' to his cart, now we can only 'change' the qty in the cart. Previously when a user want to add a product to the cart for a product which he added already in the cart, the system was adding to the quantity.  Example: The user placed product 123 in his cart for a quantity of 10. When he added again another 10 in his cart, the cart would show a total qty of 20.  Current behaviour: If he wants to add another 10 in his cart, the system is saying: 'product not added to the cart' If he selects a different amount, example 25, the system will change the cart qty to 25. (and he can no longer add an additional qty of 25)")* was created by *[softdune](/forum/user/58135-softdune "View softdune's Profile")*

-- HikaShop version -- : 4.5.0
-- Joomla version -- : 3.10.6
-- PHP version -- : 7.4.28

In previous version of Hikashop a user could 'add' to his cart, now we can only 'change' the qty in the cart.
Previously when a user want to add a product to the cart for a product which he added already in the cart, the system was adding to the quantity.

Example:
The user placed product 123 in his cart for a quantity of 10.
When he added again another 10 in his cart, the cart would show a total qty of 20.

Current behaviour:
If he wants to add another 10 in his cart, the system is saying: 'product not added to the cart'
If he selects a different amount, example 25, the system will change the cart qty to 25. (and he can no longer add an additional qty of 25)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDE4Mi1pbXBvc3NpYmxlLXRvLWFkZC1hLXByb2R1Y3QtdG8tdGhlLWNhcnQtaWYtcXVhbnRpdHktaXMtdGhlLXNhbWU/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: 86359
- Thank you received: 14296
-
-

4 years 7 months ago [\#340461](#340461) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Impossible to add a product to the cart if quantity is the same](/forum/35-orders-management/904182-impossible-to-add-a-product-to-the-cart-if-quantity-is-the-same#340461 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28  In previous version of Hikashop a user could 'add' to his cart, now we can only 'change' the qty in the cart. Previously when a user want to add a product to the cart for a product which he added already in the cart, the system was adding to the quantity.  Example: The user placed product 123 in his cart for a quantity of 10. When he added again another 10 in his cart, the cart would show a total qty of 20.  Current behaviour: If he wants to add another 10 in his cart, the system is saying: 'product not added to the cart' If he selects a different amount, example 25, the system will change the cart qty to 25. (and he can no longer add an additional qty of 25)")*

Hi,

In the latest version of HikaShop, we've added a setting "Synchronized add to cart" in the HikaShop configuration page.
That setting changes the behavior of the add to cart to what you describe if turned on.
So make sure that it's turned off, as it should be by default, and it will work like you want.

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

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

Less More

- Posts: 33
- Thank you received: 2
-
-

4 years 7 months ago [\#340484](#340484) by [softdune](/forum/user/58135-softdune "View softdune's Profile")  Replied by *[softdune](/forum/user/58135-softdune "View softdune's Profile")* on topic *[Impossible to add a product to the cart if quantity is the same](/forum/35-orders-management/904182-impossible-to-add-a-product-to-the-cart-if-quantity-is-the-same#340484 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28  In previous version of Hikashop a user could 'add' to his cart, now we can only 'change' the qty in the cart. Previously when a user want to add a product to the cart for a product which he added already in the cart, the system was adding to the quantity.  Example: The user placed product 123 in his cart for a quantity of 10. When he added again another 10 in his cart, the cart would show a total qty of 20.  Current behaviour: If he wants to add another 10 in his cart, the system is saying: 'product not added to the cart' If he selects a different amount, example 25, the system will change the cart qty to 25. (and he can no longer add an additional qty of 25)")*

My "Synchronized add to cart" is set to NO

The behavior is not as expected. With the latest version it went from a 'ADD to cart' to a 'CHANGE the cart QTY' concept.

Can you please have a validation from your side.

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

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

Less More

- Posts: 33
- Thank you received: 2
-
-

4 years 7 months ago [\#340530](#340530) by [softdune](/forum/user/58135-softdune "View softdune's Profile")  Replied by *[softdune](/forum/user/58135-softdune "View softdune's Profile")* on topic *[Impossible to add a product to the cart if quantity is the same](/forum/35-orders-management/904182-impossible-to-add-a-product-to-the-cart-if-quantity-is-the-same#340530 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28  In previous version of Hikashop a user could 'add' to his cart, now we can only 'change' the qty in the cart. Previously when a user want to add a product to the cart for a product which he added already in the cart, the system was adding to the quantity.  Example: The user placed product 123 in his cart for a quantity of 10. When he added again another 10 in his cart, the cart would show a total qty of 20.  Current behaviour: If he wants to add another 10 in his cart, the system is saying: 'product not added to the cart' If he selects a different amount, example 25, the system will change the cart qty to 25. (and he can no longer add an additional qty of 25)")*

userID and passw provided through private message

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDE4Mi1pbXBvc3NpYmxlLXRvLWFkZC1hLXByb2R1Y3QtdG8tdGhlLWNhcnQtaWYtcXVhbnRpdHktaXMtdGhlLXNhbWU/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: 86359
- Thank you received: 14296
-
-

4 years 7 months ago [\#340547](#340547) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Impossible to add a product to the cart if quantity is the same](/forum/35-orders-management/904182-impossible-to-add-a-product-to-the-cart-if-quantity-is-the-same#340547 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28  In previous version of Hikashop a user could 'add' to his cart, now we can only 'change' the qty in the cart. Previously when a user want to add a product to the cart for a product which he added already in the cart, the system was adding to the quantity.  Example: The user placed product 123 in his cart for a quantity of 10. When he added again another 10 in his cart, the cart would show a total qty of 20.  Current behaviour: If he wants to add another 10 in his cart, the system is saying: 'product not added to the cart' If he selects a different amount, example 25, the system will change the cart qty to 25. (and he can no longer add an additional qty of 25)")*

Hi,

Thanks for the accesses.
I think I know what is the issue.
It must come from the line: Code:

&lt;input type="hidden" name="add" value="&lt;?php !$this-&gt;config-&gt;get('synchronized_add_to_cart', 1); ?&gt;"/&gt;

which should be: Code:

&lt;input type="hidden" name="add" value="&lt;?php !$this-&gt;config-&gt;get('synchronized_add_to_cart', 0); ?&gt;"/&gt;

in the file components/com_hikashop/views/product/tmpl/add_to_cart_listing.php
Because of that, as long as you don't save once the configuration page with that setting "Synchronized add to cart" turned off, this piece of the code will think that the setting is activated and thus the add to cart on listings will try to replace the quantity of the product in the cart instead of adding to it.
So you have three solutions:
- save the HikaShop configuration once
- change that line of code
- download HikaShop's latest version install package on our website and install it on yours to get the patch.

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

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

Less More

- Posts: 33
- Thank you received: 2
-
-

4 years 7 months ago [\#340569](#340569) by [softdune](/forum/user/58135-softdune "View softdune's Profile")  Replied by *[softdune](/forum/user/58135-softdune "View softdune's Profile")* on topic *[Impossible to add a product to the cart if quantity is the same](/forum/35-orders-management/904182-impossible-to-add-a-product-to-the-cart-if-quantity-is-the-same#340569 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28  In previous version of Hikashop a user could 'add' to his cart, now we can only 'change' the qty in the cart. Previously when a user want to add a product to the cart for a product which he added already in the cart, the system was adding to the quantity.  Example: The user placed product 123 in his cart for a quantity of 10. When he added again another 10 in his cart, the cart would show a total qty of 20.  Current behaviour: If he wants to add another 10 in his cart, the system is saying: 'product not added to the cart' If he selects a different amount, example 25, the system will change the cart qty to 25. (and he can no longer add an additional qty of 25)")*

Hi Nicolas. Thanks for looking into this.
I could try two of your offered solutions but they are not successful.
1.
I already had done a configuration save.
2.
I could not find the code in add_to_cart_listing.php, I did find it in add_to_cart_ajax.php
After changing the code as instructed, the issue still remains.

3.
I can not install the patch for the moment. Need to wait for the weekend. Anyway, not sure if it will bring a fix based on the above.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDE4Mi1pbXBvc3NpYmxlLXRvLWFkZC1hLXByb2R1Y3QtdG8tdGhlLWNhcnQtaWYtcXVhbnRpdHktaXMtdGhlLXNhbWU/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: 86359
- Thank you received: 14296
-
-

4 years 7 months ago [\#340574](#340574) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Impossible to add a product to the cart if quantity is the same](/forum/35-orders-management/904182-impossible-to-add-a-product-to-the-cart-if-quantity-is-the-same#340574 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28  In previous version of Hikashop a user could 'add' to his cart, now we can only 'change' the qty in the cart. Previously when a user want to add a product to the cart for a product which he added already in the cart, the system was adding to the quantity.  Example: The user placed product 123 in his cart for a quantity of 10. When he added again another 10 in his cart, the cart would show a total qty of 20.  Current behaviour: If he wants to add another 10 in his cart, the system is saying: 'product not added to the cart' If he selects a different amount, example 25, the system will change the cart qty to 25. (and he can no longer add an additional qty of 25)")*

Hi,

Thanks for the feedback. I had forgotten a piece of code !
This line should be: Code:

&lt;input type="hidden" name="add" value="&lt;?php echo !$this-&gt;config-&gt;get('synchronized_add_to_cart', 0); ?&gt;"/&gt;

And yes, it should be in add_to_cart_ajax

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

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

Less More

- Posts: 33
- Thank you received: 2
-
-

4 years 7 months ago [\#340588](#340588) by [softdune](/forum/user/58135-softdune "View softdune's Profile")  Replied by *[softdune](/forum/user/58135-softdune "View softdune's Profile")* on topic *[Impossible to add a product to the cart if quantity is the same](/forum/35-orders-management/904182-impossible-to-add-a-product-to-the-cart-if-quantity-is-the-same#340588 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28  In previous version of Hikashop a user could 'add' to his cart, now we can only 'change' the qty in the cart. Previously when a user want to add a product to the cart for a product which he added already in the cart, the system was adding to the quantity.  Example: The user placed product 123 in his cart for a quantity of 10. When he added again another 10 in his cart, the cart would show a total qty of 20.  Current behaviour: If he wants to add another 10 in his cart, the system is saying: 'product not added to the cart' If he selects a different amount, example 25, the system will change the cart qty to 25. (and he can no longer add an additional qty of 25)")*

Ok. Thanks Nicolas.
Works now as expected.

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

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

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