• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

update cart through api.

General Discussion
3
8
842
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K
    karkiswapnil last edited by 26 Jul 2019, 09:58

    Hi can someone explain me how to update cart quantity through the api? I would like to know about the put request and the parameter we need to provide.
    It would be nice if you can give me an example using axios.

    1 Reply Last reply Reply Quote 0
    • R
      rahul last edited by 26 Jul 2019, 14:38

      Hi,

      Call update route of cart to update cart quantity thorough API. You need to pass data like given below.

      {"qty":{"productId":"Quantity"}} 
      

      It is a JSON format.

      You can see attach screenshot for more reference.

      Thacart-update.png nks

      1 Reply Last reply Reply Quote 0
      • K
        karkiswapnil last edited by 29 Jul 2019, 05:34

        Thank you.

        1 Reply Last reply Reply Quote 0
        • K
          karkiswapnil last edited by 29 Jul 2019, 11:50

          Hello,
          Can you also help me with api for add to cart.
          http://localhost/bagisto-master/public/api/checkout/cart/add/203

          1 Reply Last reply Reply Quote 0
          • K
            karkiswapnil last edited by 29 Jul 2019, 11:51

            Capture.PNG

            1 Reply Last reply Reply Quote 0
            • K
              karkiswapnil last edited by 29 Jul 2019, 12:09

              i also tried passing data {"product_id" : "203"}, is there something more to the payload?

              1 Reply Last reply Reply Quote 0
              • K
                karkiswapnil last edited by 29 Jul 2019, 12:31

                it took me while to figure it out what the payload needed to be
                i passed data as {"product" : "203", "quantity": "1", "is_configurable" : "false"} and it worked.
                It would have been nice if this was mentioned in the devdocs.

                1 Reply Last reply Reply Quote 0
                • 3 years later
                • K
                  klapakistan last edited by 6 Dec 2022, 20:29

                  Thanks for sharing this

                  1 Reply Last reply Reply Quote 0
                  7 out of 8
                  • First post
                    7/8
                    Last post