Login on checkout redirect to checkout
-
Dear bagisto,
how to redirect it to current checkout when we login ?
-
@otheriz
Didn't get your query , please explain. -
currently, when customer checkout with "Guest Checkout" disabled...it will be redirected to the login page..
and when we login..it not redirect to the checkout page...but to the profile page...it should go to the checkout page..or previous page
how to do it ?
this issue causes some trouble now...there's some newbie and veeerrrryyyy newbie user...they confuse with this profile redirected..even some get stuck(very confuse) in the profile page -_- ...
-
Hello @otheriz
To achive the desired result as you mentioned, kindly follow these step:-
-
First open
"$root_folder/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php" and "$root_folder/packages/Webkul/Customer/src/Http/Controllers/SessionController.php" file. -
add this line " session()->put('backToOnePage', true); " inside if condition (line 73) before redirection on OnepageController.php file.
https://github.com/bagisto/bagisto/blob/master/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php#L73 -
replace this " return redirect()->intended(route($this->_config['redirect'])); " (line 84) with the code below on SessionController.php" file.
https://github.com/bagisto/bagisto/blob/master/packages/Webkul/Customer/src/Http/Controllers/SessionController.php#L84
if (session()->has('backToOnePage')) { session()->forget('backToOnePage'); return redirect()->route('shop.checkout.onepage.index'); } else { return redirect()->intended(route($this->_config['redirect'])); }
- Save both the file.
-