Unfortunately I have realised that this method is not sufficient for PayPal Express Checkout which I am using.
The problem is:
With PayPal Express checkout the user is directed to log in when they have returned from PayPal. This is because the confirm page directs them.
Although this would work if the customer is already registered with my website, in the situation when they are not, they would have to leave the transaction process, in order to register and then have to restart the payment process, which is highly unprofessional.
What I need to do is create some sort of trigger, when the user click the checkout button on the cart page, it immediately should check to see if the user is logged in, in which case, the user is either directed to login/register, or PayPal to proceed with payment.
Hope you can help,
Thank you in advance