Author Topic: How can i remove product from cart ?  (Read 2662 times)

Offline ahmad-sabra

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
How can i remove product from cart ?
« 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.

Online abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4080
  • Karma: +243/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: How can i remove product from cart ?
« Reply #1 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

We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline ahmad-sabra

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: How can i remove product from cart ?
« Reply #2 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.

Online abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4080
  • Karma: +243/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: How can i remove product from cart ?
« Reply #3 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



We need your help to build better free open source eCommerce platform for everyone.
See how you can help