Bagisto Forum

    Bagisto

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

    Login on checkout redirect to checkout

    Knowledge Base
    3
    4
    499
    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.
    • O
      otheriz last edited by

      Dear bagisto,

      how to redirect it to current checkout when we login ?

      1 Reply Last reply Reply Quote 0
      • V
        Vaishali Agarwal last edited by

        @otheriz
        Didn't get your query , please explain.

        1 Reply Last reply Reply Quote 0
        • O
          otheriz last edited by otheriz

          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 -_- ...

          1 Reply Last reply Reply Quote 0
          • V
            vishalK last edited by

            Hello @otheriz

            To achive the desired result as you mentioned, kindly follow these step:-

            1. First open
              "$root_folder/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php" and "$root_folder/packages/Webkul/Customer/src/Http/Controllers/SessionController.php" file.

            2. 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

            3. 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']));
            }
            
            1. Save both the file.
            1 Reply Last reply Reply Quote 0
            • First post
              Last post