Make it as painless as possible, do not request login when users are still exploring products.
Some articles:
Shopping Cart or Wishlist? Saving Products for Later in Ecommerce
The shopping cart is not only a place to store items until purchase: it is a comparison table, a reference, a scrapbook for ideas. Thus, contrary to the modern ecommerce teams’ beliefs, adding an item to a shopping cart doesn’t necessarily mean that the item has a high chance of being purchased right away. People often use the shopping cart as a tool to help them make purchasing decisions, and the shopping cart is as much a sandbox for consideration of products as it is a direct means to purchase. Keep that in mind if you’re tracking shopping-cart abandonment as one of your analytics metrics: an item left in the shopping cart may actually be leading to a purchase later on.
Users often wish to purchase only some of their cart’s contents right away, but don’t want to lose all the work that went into finding other products of interest. Provide an easy-to-find feature to save items for later, label it something else than “wishlist,” and don’t block access to it with login walls.
Login Walls Stop Users in Their Tracks
As a rule of thumb, we recommend that you use the reciprocity principle when considering a login wall in front of your users. Always weigh in what the perceived benefits are for the users: if there is the slimmest chance that those benefits are not evident, forego the login wall — either all together or by pushing it to the point where users are convinced of the logic behind it and know exactly what to expect from your site.