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

#   Creating delete link

##

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

Less More

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

11 years 1 month ago [\#213397](#213397) by [Mikemike](/forum/user/30063-mikemike "View Mikemike's Profile")  *[Creating delete link](/forum/26-product-category-display/879118-creating-delete-link#213397 "-- HikaShop version -- : 2.4  Hey guys,  just quick. I need to create a delete like so: index.php?option=com&#95;hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=1  but when I send this link via Ajax, it doesnt delete the product from the cart, any hints?  Thanks guys.")* was created by *[Mikemike](/forum/user/30063-mikemike "View Mikemike's Profile")*

-- HikaShop version -- : 2.4

Hey guys,

just quick. I need to create a delete like so: index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=1

but when I send this link via Ajax, it doesnt delete the product from the cart, any hints?

Thanks guys.

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

Less More

- Posts: 86293
- Thank you received: 14271
-
-

11 years 1 month ago [\#213400](#213400) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Creating delete link](/forum/26-product-category-display/879118-creating-delete-link#213400 "-- HikaShop version -- : 2.4  Hey guys,  just quick. I need to create a delete like so: index.php?option=com&#95;hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=1  but when I send this link via Ajax, it doesnt delete the product from the cart, any hints?  Thanks guys.")*

Hi,

Use such link instead:
index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=1&amp;add=0

Otherwise, the system will add a product with a quantity of 0 instead of replacing the product quantity in the cart with the quantity 0.

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

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

Less More

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

11 years 1 month ago -  11 years 1 month ago [\#213616](#213616) by [Mikemike](/forum/user/30063-mikemike "View Mikemike's Profile")  Replied by *[Mikemike](/forum/user/30063-mikemike "View Mikemike's Profile")* on topic *[Creating delete link](/forum/26-product-category-display/879118-creating-delete-link#213616 "-- HikaShop version -- : 2.4  Hey guys,  just quick. I need to create a delete like so: index.php?option=com&#95;hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=1  but when I send this link via Ajax, it doesnt delete the product from the cart, any hints?  Thanks guys.")*

Hey Nic,

thanks, that did the trick! Just another short one :blush: :

index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=1&amp;product_id=744&amp;hikashop_product_option[0]=7&amp;hikashop_product_option[5]=12&amp;hikashop_product_custom_item_value[42]=testtext

any idea, why the product_custom_item_value doenst work in this example?

Thanks :DD

Last edit: 11 years 1 month ago by [Mikemike](/forum/user/30063-mikemike "View Mikemike's Profile").

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

Less More

- Posts: 86293
- Thank you received: 14271
-
-

11 years 1 month ago [\#213624](#213624) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Creating delete link](/forum/26-product-category-display/879118-creating-delete-link#213624 "-- HikaShop version -- : 2.4  Hey guys,  just quick. I need to create a delete like so: index.php?option=com&#95;hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=1  but when I send this link via Ajax, it doesnt delete the product from the cart, any hints?  Thanks guys.")*

Hi,

That's because there is no product_custom_item_value parameter for the add to cart URL.
Here is a thread explaining how to fill in custom item fields for the add to cart URL:
[ www.hikashop.com/forum/2-general-talk-ab...-product-fields.html](http://www.hikashop.com/forum/2-general-talk-about-hikashop/16216-add-to-cart-link-and-custom-product-fields.html)

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

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

Less More

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

11 years 3 weeks ago -  11 years 3 weeks ago [\#216299](#216299) by [Mikemike](/forum/user/30063-mikemike "View Mikemike's Profile")  Replied by *[Mikemike](/forum/user/30063-mikemike "View Mikemike's Profile")* on topic *[Creating delete link](/forum/26-product-category-display/879118-creating-delete-link#216299 "-- HikaShop version -- : 2.4  Hey guys,  just quick. I need to create a delete like so: index.php?option=com&#95;hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=1  but when I send this link via Ajax, it doesnt delete the product from the cart, any hints?  Thanks guys.")*

Hey Nic,

another thing about the delete link:

when I use: index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=**1**&amp;add=0
it works for the first product in the cart.

But for example:
index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=**3**&amp;add=0
it doenst delete the 3 product in the cart.

I saw on the delte button generated by HikaShop, that sometimes there are total different cart ids, for example:

&lt;a title="Löschen" onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_203768'); if(qty_field){qty_field.value=0; document.getElementById('product_option_203769').value=qty_field.value;document.getElementById('product_option_203770').value=qty_field.value; qty_field.form.submit();} return false;" href="/checkout/product/updatecart/quantity-0/return_url-aHR0cDovL3d3dy5yb2FkYnVyZ2VyLmF0L2NoZWNrb3V0/**cid-744**" class="hikashop_no_print"&gt;

so I tried to use this:
index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=**744**&amp;add=0
But also no luck with that kind of cart ids.

Any ideas about that?

Thanks!

Last edit: 11 years 3 weeks ago by [Mikemike](/forum/user/30063-mikemike "View Mikemike's Profile").

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

Less More

- Posts: 86293
- Thank you received: 14271
-
-

11 years 3 weeks ago [\#216314](#216314) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Creating delete link](/forum/26-product-category-display/879118-creating-delete-link#216314 "-- HikaShop version -- : 2.4  Hey guys,  just quick. I need to create a delete like so: index.php?option=com&#95;hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=0&amp;cid=1  but when I send this link via Ajax, it doesnt delete the product from the cart, any hints?  Thanks guys.")*

Hi,

You should give the id of the product in the cid parameter and not the position of the product in the cart.
Also, if you have several lines for that product in the cart, it will only remove one of them.

I'm not sure what you're trying to do. If you want to clear the whole cart, you can simply call:
index.php?option=com_hikashop&amp;ctrl=product&amp;task=cleancart

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

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

[](#top)
