buy now api
-
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 ?
Best regards
-
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 -
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
-
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,
-
@Vaishali-Agarwal said in buy now api:
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 ?
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
-
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 ?
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&[email protected]
but not sure if is_buy_now should contain a value also ?
regards
-
Hello is any one there ?
-
Hello there
-
@cmpengineers
allow me some time, i will update you.Thanks
-
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.
- First of all you need to pass is_buy_now in parameter with value true.
- Now go to add to cart api controller here if condition is already there related to is_buy_now.
- 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.
- 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