divio/django-shop — pull request #169 by neo64bit (2012-07-26 08:25:26+00:00)
Title: Rewrote get_or_create_cart to behave differently

The problem I have with the current implementation of get_or_create_cart, is that after a user logs in, they always lose whatever they had in the cart before logging in. This fixes it by checking if the old cart in the database is empty, and if it is, replacing it by the new one from the session.

Do you think it's a good idea to prioritize the old, database cart before the newer one? Should the new, session cart overwrite the database cart instead? Could we perhaps merge the carts? I'm not sure how other shops handle this, feedback is welcome.