Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: How can i remove product from cart ?  (Read 28111 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.

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4362
  • Karma: +301/-10
    • 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

Please  rate your experience or leave your review
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.

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4362
  • Karma: +301/-10
    • 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



Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline Rawinder

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

Offline Rawinder

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: How can i remove product from cart ?
« Reply #5 on: August 31, 2020, 04:35:22 PM »
check this screen shot

Offline MarkOrion

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

Offline amypond

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
  • Follow my link bellow
    • View Profile
    • it jobs in demand in 2024
Re: How can i remove product from cart ?
« Reply #7 on: July 11, 2023, 07:11:45 AM »
oh it was really useful

 

Powered by SMFPacks Social Login Mod