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

#   Updating Cart in Variant instead of Quantity

##

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

Less More

- Posts: 23
- Thank you received: 0
-
-

15 years 7 months ago [\#9701](#9701) by [luciomonter](/forum/user/673-luciomonter "View luciomonter's Profile")  *[Updating Cart in Variant instead of Quantity](/forum/4-how-to/9701-updating-cart-in-variant-instead-of-quantity#9701 "Hi everybody, I'm running hikashop business 1.4.7 and I've searched the forum, hope I don't ask for a solved thread!  I've customized the cart view to show a dropdown with all the variant I've set for a product. Variants are actually duration like 3 months, 6 months ect, but I think it doesn't matters...  Now I would like to run via javascript an UPDATE CART LINK to update the cart with the new variant...  Looking at the DELETE LINK I see it's just a quantity variation to zero calling the update cart more or less like this:  /axonline/index.php/it/component/hikashop/product/updatecart/product&#95;id-27/quantity-0/return&#95;url- aHR0cDovL2xvY2FsaG9zdC9heG9ubGluZS9pbmRleC5waHAvaXQvY29tcG9uZW50L2hpa2FzaG9wL2NoZWNrb3V0L3N0ZXAvc3RlcC0x  Not considering the return&#95;url I can imagine this link ask to update the cart removing the product with id 27 from the cart  Is there a way I can ask via URL a think like: /axonline/index.php/it/component/hikashop/product/updatecart/cart&#95;product&#95;id-165/product&#95;id-28/  Where I'm asking the cart to be updated at the &quot;table row&quot; 165 with the new variant selected that is product&#95;id 28 ?!?  If there is no way to do it via URL, can you suggest where should I begin to change the source code...?!?  Thanks a lot Luciomonter")* was created by *[luciomonter](/forum/user/673-luciomonter "View luciomonter's Profile")*

Hi everybody,
I'm running hikashop business 1.4.7 and I've searched the forum, hope I don't ask for a solved thread!

I've customized the cart view to show a dropdown with all the variant I've set for a product. Variants are actually duration like 3 months, 6 months ect, but I think it doesn't matters...

Now I would like to run via javascript an UPDATE CART LINK to update the cart with the new variant...

Looking at the DELETE LINK I see it's just a quantity variation to zero calling the update cart more or less like this:

/axonline/index.php/it/component/hikashop/product/updatecart/product_id-27/quantity-0/return_url-
aHR0cDovL2xvY2FsaG9zdC9heG9ubGluZS9pbmRleC5waHAvaXQvY29tcG9uZW50L2hpa2FzaG9wL2NoZWNrb3V0L3N0ZXAvc3RlcC0x

Not considering the return_url I can imagine this link ask to update the cart removing the product with id 27 from the cart

Is there a way I can ask via URL a think like:
/axonline/index.php/it/component/hikashop/product/updatecart/cart_product_id-165/product_id-28/

Where I'm asking the cart to be updated at the "table row" 165 with the new variant selected that is product_id 28 ?!?

If there is no way to do it via URL, can you suggest where should I begin to change the source code...?!?

Thanks a lot
Luciomonter

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

Less More

- Posts: 86308
- Thank you received: 14273
-
-

15 years 7 months ago -  15 years 7 months ago [\#9724](#9724) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Updating Cart in Variant instead of Quantity](/forum/4-how-to/9701-updating-cart-in-variant-instead-of-quantity#9724 "Hi everybody, I'm running hikashop business 1.4.7 and I've searched the forum, hope I don't ask for a solved thread!  I've customized the cart view to show a dropdown with all the variant I've set for a product. Variants are actually duration like 3 months, 6 months ect, but I think it doesn't matters...  Now I would like to run via javascript an UPDATE CART LINK to update the cart with the new variant...  Looking at the DELETE LINK I see it's just a quantity variation to zero calling the update cart more or less like this:  /axonline/index.php/it/component/hikashop/product/updatecart/product&#95;id-27/quantity-0/return&#95;url- aHR0cDovL2xvY2FsaG9zdC9heG9ubGluZS9pbmRleC5waHAvaXQvY29tcG9uZW50L2hpa2FzaG9wL2NoZWNrb3V0L3N0ZXAvc3RlcC0x  Not considering the return&#95;url I can imagine this link ask to update the cart removing the product with id 27 from the cart  Is there a way I can ask via URL a think like: /axonline/index.php/it/component/hikashop/product/updatecart/cart&#95;product&#95;id-165/product&#95;id-28/  Where I'm asking the cart to be updated at the &quot;table row&quot; 165 with the new variant selected that is product&#95;id 28 ?!?  If there is no way to do it via URL, can you suggest where should I begin to change the source code...?!?  Thanks a lot Luciomonter")*

Suppose that you have a product with two variants XX and YY and that you currently have 1 XX in the cart and that the user switches to YY, you could try to use such URL (I post the unSEFed URL so that other users can easily use it):

index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;data[XX]=0&amp;data[YY]=1

Last edit: 15 years 7 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile"). Reason: updated code

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

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

Less More

- Posts: 23
- Thank you received: 0
-
-

15 years 7 months ago [\#9730](#9730) by [luciomonter](/forum/user/673-luciomonter "View luciomonter's Profile")  Replied by *[luciomonter](/forum/user/673-luciomonter "View luciomonter's Profile")* on topic *[Re: Updating Cart in Variant instead of Quantity](/forum/4-how-to/9701-updating-cart-in-variant-instead-of-quantity#9730 "Hi everybody, I'm running hikashop business 1.4.7 and I've searched the forum, hope I don't ask for a solved thread!  I've customized the cart view to show a dropdown with all the variant I've set for a product. Variants are actually duration like 3 months, 6 months ect, but I think it doesn't matters...  Now I would like to run via javascript an UPDATE CART LINK to update the cart with the new variant...  Looking at the DELETE LINK I see it's just a quantity variation to zero calling the update cart more or less like this:  /axonline/index.php/it/component/hikashop/product/updatecart/product&#95;id-27/quantity-0/return&#95;url- aHR0cDovL2xvY2FsaG9zdC9heG9ubGluZS9pbmRleC5waHAvaXQvY29tcG9uZW50L2hpa2FzaG9wL2NoZWNrb3V0L3N0ZXAvc3RlcC0x  Not considering the return&#95;url I can imagine this link ask to update the cart removing the product with id 27 from the cart  Is there a way I can ask via URL a think like: /axonline/index.php/it/component/hikashop/product/updatecart/cart&#95;product&#95;id-165/product&#95;id-28/  Where I'm asking the cart to be updated at the &quot;table row&quot; 165 with the new variant selected that is product&#95;id 28 ?!?  If there is no way to do it via URL, can you suggest where should I begin to change the source code...?!?  Thanks a lot Luciomonter")*

Sorry Nicolas, can't get into it....
I'm trying:

index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;item[18][cart_product_quantity]=4

where 18 is the product_id of the product already in the cart to check if I can at least affect the quantity of this item by setting it to 4... Nothing seems to appen, even on the jos_hikashop_cart_product table in the DB.... what am i doing wrong?

Many Thanks in advance for your help
cheers

Luciomonter

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

Less More

- Posts: 86308
- Thank you received: 14273
-
-

15 years 7 months ago [\#9739](#9739) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Updating Cart in Variant instead of Quantity](/forum/4-how-to/9701-updating-cart-in-variant-instead-of-quantity#9739 "Hi everybody, I'm running hikashop business 1.4.7 and I've searched the forum, hope I don't ask for a solved thread!  I've customized the cart view to show a dropdown with all the variant I've set for a product. Variants are actually duration like 3 months, 6 months ect, but I think it doesn't matters...  Now I would like to run via javascript an UPDATE CART LINK to update the cart with the new variant...  Looking at the DELETE LINK I see it's just a quantity variation to zero calling the update cart more or less like this:  /axonline/index.php/it/component/hikashop/product/updatecart/product&#95;id-27/quantity-0/return&#95;url- aHR0cDovL2xvY2FsaG9zdC9heG9ubGluZS9pbmRleC5waHAvaXQvY29tcG9uZW50L2hpa2FzaG9wL2NoZWNrb3V0L3N0ZXAvc3RlcC0x  Not considering the return&#95;url I can imagine this link ask to update the cart removing the product with id 27 from the cart  Is there a way I can ask via URL a think like: /axonline/index.php/it/component/hikashop/product/updatecart/cart&#95;product&#95;id-165/product&#95;id-28/  Where I'm asking the cart to be updated at the &quot;table row&quot; 165 with the new variant selected that is product&#95;id 28 ?!?  If there is no way to do it via URL, can you suggest where should I begin to change the source code...?!?  Thanks a lot Luciomonter")*

Right. I've updated the code. It's actually with data...With item it's for something else ![:)](/media/kunena/emoticons/8.png ":)")

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

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

Less More

- Posts: 23
- Thank you received: 0
-
-

15 years 7 months ago [\#9749](#9749) by [luciomonter](/forum/user/673-luciomonter "View luciomonter's Profile")  Replied by *[luciomonter](/forum/user/673-luciomonter "View luciomonter's Profile")* on topic *[Re: Updating Cart in Variant instead of Quantity](/forum/4-how-to/9701-updating-cart-in-variant-instead-of-quantity#9749 "Hi everybody, I'm running hikashop business 1.4.7 and I've searched the forum, hope I don't ask for a solved thread!  I've customized the cart view to show a dropdown with all the variant I've set for a product. Variants are actually duration like 3 months, 6 months ect, but I think it doesn't matters...  Now I would like to run via javascript an UPDATE CART LINK to update the cart with the new variant...  Looking at the DELETE LINK I see it's just a quantity variation to zero calling the update cart more or less like this:  /axonline/index.php/it/component/hikashop/product/updatecart/product&#95;id-27/quantity-0/return&#95;url- aHR0cDovL2xvY2FsaG9zdC9heG9ubGluZS9pbmRleC5waHAvaXQvY29tcG9uZW50L2hpa2FzaG9wL2NoZWNrb3V0L3N0ZXAvc3RlcC0x  Not considering the return&#95;url I can imagine this link ask to update the cart removing the product with id 27 from the cart  Is there a way I can ask via URL a think like: /axonline/index.php/it/component/hikashop/product/updatecart/cart&#95;product&#95;id-165/product&#95;id-28/  Where I'm asking the cart to be updated at the &quot;table row&quot; 165 with the new variant selected that is product&#95;id 28 ?!?  If there is no way to do it via URL, can you suggest where should I begin to change the source code...?!?  Thanks a lot Luciomonter")*

Beautiful Nicolas!
Works perfectly

Thanks a lot

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

- **[happiexy](/forum/user/33007-happiexy "View happiexy's Profile")**
- [![happiexy's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/quiet.jpg)](/forum/user/33007-happiexy "View happiexy's Profile")
- [ Offline](/forum/user/33007-happiexy "I'm a full-stack developer developer from Nairobi Kenya, who just takes longer to get to solutions.  Visit https://patric.xyz for more.  ")
- ^\_^

Less More

- Posts: 15
- Thank you received: 0
-
-
-
- [](http://patric.xyz)
-

12 years 4 months ago [\#160345](#160345) by [happiexy](/forum/user/33007-happiexy "View happiexy's Profile")  Replied by *[happiexy](/forum/user/33007-happiexy "View happiexy's Profile")* on topic *[Re: Updating Cart in Variant instead of Quantity](/forum/4-how-to/9701-updating-cart-in-variant-instead-of-quantity#160345 "Hi everybody, I'm running hikashop business 1.4.7 and I've searched the forum, hope I don't ask for a solved thread!  I've customized the cart view to show a dropdown with all the variant I've set for a product. Variants are actually duration like 3 months, 6 months ect, but I think it doesn't matters...  Now I would like to run via javascript an UPDATE CART LINK to update the cart with the new variant...  Looking at the DELETE LINK I see it's just a quantity variation to zero calling the update cart more or less like this:  /axonline/index.php/it/component/hikashop/product/updatecart/product&#95;id-27/quantity-0/return&#95;url- aHR0cDovL2xvY2FsaG9zdC9heG9ubGluZS9pbmRleC5waHAvaXQvY29tcG9uZW50L2hpa2FzaG9wL2NoZWNrb3V0L3N0ZXAvc3RlcC0x  Not considering the return&#95;url I can imagine this link ask to update the cart removing the product with id 27 from the cart  Is there a way I can ask via URL a think like: /axonline/index.php/it/component/hikashop/product/updatecart/cart&#95;product&#95;id-165/product&#95;id-28/  Where I'm asking the cart to be updated at the &quot;table row&quot; 165 with the new variant selected that is product&#95;id 28 ?!?  If there is no way to do it via URL, can you suggest where should I begin to change the source code...?!?  Thanks a lot Luciomonter")*

Hello,
I'm trying to update product quantity in the checkout page, and it is not working. It submits when I hit refresh. Kindly help.

---

![:)](/media/kunena/emoticons/8.png ":)")

fFull-stack

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

Less More

- Posts: 86308
- Thank you received: 14273
-
-

12 years 4 months ago [\#160428](#160428) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Updating Cart in Variant instead of Quantity](/forum/4-how-to/9701-updating-cart-in-variant-instead-of-quantity#160428 "Hi everybody, I'm running hikashop business 1.4.7 and I've searched the forum, hope I don't ask for a solved thread!  I've customized the cart view to show a dropdown with all the variant I've set for a product. Variants are actually duration like 3 months, 6 months ect, but I think it doesn't matters...  Now I would like to run via javascript an UPDATE CART LINK to update the cart with the new variant...  Looking at the DELETE LINK I see it's just a quantity variation to zero calling the update cart more or less like this:  /axonline/index.php/it/component/hikashop/product/updatecart/product&#95;id-27/quantity-0/return&#95;url- aHR0cDovL2xvY2FsaG9zdC9heG9ubGluZS9pbmRleC5waHAvaXQvY29tcG9uZW50L2hpa2FzaG9wL2NoZWNrb3V0L3N0ZXAvc3RlcC0x  Not considering the return&#95;url I can imagine this link ask to update the cart removing the product with id 27 from the cart  Is there a way I can ask via URL a think like: /axonline/index.php/it/component/hikashop/product/updatecart/cart&#95;product&#95;id-165/product&#95;id-28/  Where I'm asking the cart to be updated at the &quot;table row&quot; 165 with the new variant selected that is product&#95;id 28 ?!?  If there is no way to do it via URL, can you suggest where should I begin to change the source code...?!?  Thanks a lot Luciomonter")*

Hi,

Please provide a link to the shop so that we can look at that.

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

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

[](#top)
