I have built a custom WooCommerce Theme for a client. On the checkout page the user has the option to - Login to his existing account (empties the cart) - Register a new account (works) - (if logged in) logout and login to another account (empties the cart)
I need to change this behavior and allow the user to login/logout without losing their cart content. I have looked into the WooCommerce Core but couldn't figure out how to achieve this. The session handler class seems to save the cart contents based on the customer_id but I'm not sure if it's possible to change that.
Can you help me fix this problem? Maybe someone has already done this or something similar.