I am creating an e-commerce platform. I have set up so that even when a user is not logged in they can add items to their basket. If a user goes on to sign up for an account, the products that were in their temporary basket are automatically transferred to their basket once signed up. This element works fine.
The problem arises if a user already has an account but it not logged in. In this scenario, once a user has logged in the items in their temporary cart are not transferred to their logged in account and therefore lost. Can you help me to find a solution?