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

Bagisto

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

buy now api

General Discussion
3
10
495
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.
  • C
    cmpengineers last edited by 20 Mar 2020, 07:50

    Dear all

    i want to make buy now also api so i can connected for mobile device ?

    how would i do it , just create new api route for the same controller buy now ?

    Screen Shot 2020-03-20 at 10.45.22 AM.png

    Best regards

    1 Reply Last reply Reply Quote 0
    • V
      Vaishali Agarwal last edited by 20 Mar 2020, 08:37

      Hi @cmpengineers

      currently Buy Now API is not implemented.
      You can create & implement by own as same like Add to cart API
      https://devdocs.bagisto.com/api_cart.html

      1 Reply Last reply Reply Quote 0
      • C
        cmpengineers last edited by 20 Mar 2020, 09:37

        Hi @Vaishali-Agarwal

        much appreciate for your fast response

        can you explain a little more in details " You can create & implement by own "

        you mean using the same cart controller ? and create an api for it ?

        i did not understand

        best regards

        1 Reply Last reply Reply Quote 0
        • V
          Vaishali Agarwal last edited by 20 Mar 2020, 10:35

          @cmpengineers

          You just need to call this api to adding product to cart https://github.com/bagisto/bagisto/blob/master/packages/Webkul/API/Http/routes.php#L252

          and send this argument with get request https://github.com/bagisto/bagisto/blob/master/packages/Webkul/API/Http/Controllers/Shop/CartController.php#L94

          once is_buy_now get request done, then Buy Now will be working.

          Thanks,

          C 1 Reply Last reply 14 Nov 2020, 15:31 Reply Quote 0
          • 8 months later
          • C
            cmpengineers @Vaishali Agarwal last edited by cmpengineers 14 Nov 2020, 15:53 14 Nov 2020, 15:31

            @Vaishali-Agarwal said in buy now api:

            https://github.com/bagisto/bagisto/blob/master/packages/Webkul/API/Http/Controllers/Shop/CartController.php#L94

            Dear @Vaishali-Agarwal

            I'm trying to send the is_buy_now as get request how would I do it in postman

            is the key ? the is_buy_now and what about the value ? is the product id ?

            Screen Shot 2020-11-14 at 6.30.37 PM.png

            https://drov112dev.test/api/checkout/buy-now/cart/add/5?is_buy_now
            
            https://drov112dev.test/api/checkout/buy-now/cart/add/5?is_buy_now=5 
            
            https://drov112dev.test/api/checkout/buy-now/cart/add/?is_buy_now=5 
            
             Route::get('cart/add/{id}', 'CartController@store'); is this the correct API ? for buy now 
            

            please advise how to do the URL get with buy now

            regards

            1 Reply Last reply Reply Quote 0
            • C
              cmpengineers last edited by 15 Nov 2020, 11:41

              @Vaishali-Agarwal

              i did it but not sure if its the correct way i have created get API similar to

              when you pass is_buy_now as key right ? but what its the value should have ?

              Screen Shot 2020-11-15 at 2.39.03 PM.png

                Route::post('cart/add/{id}', 'CartController@store');
                          
                Route::get('cart/add/{id}','CartController@store');
              

              and for API URL

              https://drov112dev.test/api/checkout/cart/add/5/?product_id=5&is_buy_now=&quantity=50&customer_email=cmp@gmail.com
              

              but not sure if is_buy_now should contain a value also ?

              regards

              1 Reply Last reply Reply Quote 0
              • C
                cmpengineers last edited by 16 Nov 2020, 12:44

                @Vaishali-Agarwal

                Hello is any one there ?

                1 Reply Last reply Reply Quote 0
                • C
                  cmpengineers last edited by 16 Nov 2020, 15:05

                  Hello there

                  1 Reply Last reply Reply Quote 0
                  • V
                    Vaishali Agarwal last edited by 16 Nov 2020, 16:48

                    @cmpengineers
                    allow me some time, i will update you.

                    Thanks

                    1 Reply Last reply Reply Quote 0
                    • V
                      vishalK last edited by vishalK 17 Nov 2020, 06:45 17 Nov 2020, 06:45

                      Hi @cmpengineers
                      From buy now api you mean when customer click on buy now so product added into cart and customer directly redirect to checkout or view cart page, please correct me if i am wrong.

                      So for this you have to do customisation in add to cart api.

                      1. First of all you need to pass is_buy_now in parameter with value true.
                      2. Now go to add to cart api controller here if condition is already there related to is_buy_now.
                      3. Now you need to add some custom parameter in return response so that you could identify that customer is using buy now btn instead of add to cart.
                      4. So at the last whenever you received your custom parameter in response so redirect the customer to the desired page.

                      You can implement this in both ways by adding new controller or modify existing add to cart controller.

                      Thanks

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