AbanteCart Development > API Development

How can i remove product from cart ?

(1/2) > >>

ahmad-sabra:
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.

abantecart:
Welcome to AbanteCart

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

ahmad-sabra:
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.

abantecart:

--- Quote from: ahmad-sabra on March 09, 2016, 05:37:35 AM ---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.

--- End quote ---

I just tried this and this what works for me

This is my cart responce

--- Code: ---{
    "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"
        }
    ]
}

--- End code ---

This is my request to remove from cart.

--- Code: ---rt=a/checkout/cart&remove[51:5b448a7bdbeea0be7d7f758f5f8ee90b]=1&api_key=

--- End code ---
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



Rawinder:
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 

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Social Login Mod