AbanteCart Community

AbanteCart Development => API Development => Topic started by: ahmad-sabra on March 04, 2016, 09:42:23 AM

Title: How can i remove product from cart ?
Post by: ahmad-sabra on March 04, 2016, 09:42:23 AM
hello ,
i'm developing a application that can work with abanteCart Api.Im using Java language in my development.
 i'm trying to remove product added to cart. ( this is the request that i use rt=a/checkout/cart&remove["+Key+"]=1 ).

Please help.
Title: Re: How can i remove product from cart ?
Post by: abantecart on March 04, 2016, 03:16:39 PM
Welcome to AbanteCart

API Path to delete item from the cart will be rt=a/checkout/cart/delete&remove["+Key+"]=1

Title: Re: How can i remove product from cart ?
Post by: ahmad-sabra on March 09, 2016, 05:37:35 AM
thanks for your reply,

i have tried what you have mentioned and nothing changed. It's return 200 OK but with empty response.
plus the item wont be removed from the cart. that's the full request :
"?rt=a/checkout/cart/delete&remove[115:c4dd264669bc468c6125ef91e8fb4cc5]=1".

best regards.
Title: Re: How can i remove product from cart ?
Post by: abantecart on March 10, 2016, 12:39:01 PM
i have tried what you have mentioned and nothing changed. It's return 200 OK but with empty response.
plus the item wont be removed from the cart. that's the full request :
"?rt=a/checkout/cart/delete&remove[115:c4dd264669bc468c6125ef91e8fb4cc5]=1".

best regards.

I just tried this and this what works for me

This is my cart responce
Code: [Select]
{
    "products":[
        {
            "key":"51:5b448a7bdbeea0be7d7f758f5f8ee90b",
            "name":"BeneFit Girl Meets Pearl",
            "model":"483857",
            "thumb":"http:\/\/localhost\/abantecart126\/image\/thumbnails\/18\/6b\/demo_product02_jpg-100026-75x75.jpg",
            "option":[
               
            ],
            "quantity":1,
            "stock":true,
            "price":"$19.00",
            "total":"$19.00"
        }
    ],
    "weight":false,
    "totals":[
        {
            "id":"subtotal",
            "title":"Sub-Total:",
            "text":"$19.00",
            "value":19,
            "sort_order":"1",
            "total_type":"subtotal"
        },
        {
            "id":"tax",
            "title":"Retail 8.5%:",
            "text":"$1.62",
            "value":1.615,
            "sort_order":"5.1",
            "total_type":"tax"
        },
        {
            "id":"tax",
            "title":"tax #2:",
            "text":"$0.95",
            "value":0.95,
            "sort_order":"5.1",
            "total_type":"tax"
        },
        {
            "id":"total",
            "title":"Total:",
            "text":"$21.57",
            "value":21.565,
            "sort_order":1000,
            "total_type":"total"
        }
    ]
}

This is my request to remove from cart.
Code: [Select]
rt=a/checkout/cart&remove[51:5b448a7bdbeea0be7d7f758f5f8ee90b]=1&api_key=
NOTE: This needs to be POST request.

If you need GET request to delete item from the cart, I have updated test script
https://github.com/abantecart/testing_tools/blob/master/test_api.php

Also there is a small fix for response in 1.2.6
https://github.com/abantecart/abantecart-src/commit/ed807585c60b64ca08c4dc560c568f68486ab2fe



Title: Re: How can i remove product from cart ?
Post by: Rawinder on August 31, 2020, 04:30:35 PM
Hi
can you plz tell me what this value is ?
5b448a7bdbeea0be7d7f758f5f8ee90b ??
u r using in your code?
im getting only product id as key when i fetch cart from api .
Thx in Advance 
Title: Re: How can i remove product from cart ?
Post by: Rawinder on August 31, 2020, 04:35:22 PM
check this screen shot
Title: Re: How can i remove product from cart ?
Post by: MarkOrion on April 20, 2021, 02:53:01 AM
You may remove items from your cart by clicking the "Shopping Cart" button, which is located just below the navigation menu. Click the selection box beside the item(s) you'd like to remove, and then click the "Remove Selected" button.