We have separate page for the Login and Signup, and we are using a plugin to force the checkout user as he goes to purchase.
Login Page : we are using the Login with otp Module, which is set to redirect to checkout page
Signup Page : we are using Ultimate member form , and afte login we have set it to redirect on checkout page using the plugin User Setting
So we have issue with login and signup and for the same we have 2 Case
Case 1 :
Step 1 – A User comes to our website
Step 2 – He Adds a Product to Cart
Step 3 – He clicks on “View Cart” or “Proceed to CHeckout” , he will be redirected to Login Page
here if he has Account he will login DIrectly, else he will click on SIgnup
Step 4 – After Login or Signup , he will be redirected to the Checkout Page.
Case 2 :
Step 1 – A user visit our website
Step 2 – He don’t Add any product / he is just surfing the website and he click on the login page
Step 3 – he is shown thee login page or SignUp page
Step 4 – he will be redirected to homepage, and As he has not added any product to cart , he will not be redirected to checkout page
Now the Case 1 is solved by using the redirect, but we are unable to get the Case 2 we are not able to solve it
i have tried the Custom function , but it is not working properly,
how i am seeing the logic to be solved is, if we can store the data or flow through which user is coming the login page we can change the thing
if he comes from proceed to Checkout he will be sent to the checkout page after the Action, but if not he will be sent to Home page.
Please have a look at this and help us,