shopping cart for non registered users

前端 未结 6 898
甜味超标
甜味超标 2020-12-08 01:13

I am in the process of making a website that involves a shopping cart. There are two major requirements:

  1. The user experience guys want login/authentication

6条回答
  •  半阙折子戏
    2020-12-08 01:53

    If you're using ASP.NET here's what I'm (about) to do:

    • use a Profile to capture the users email as soon as possible (to email them if they dont complete the order). you can enable anonymous profile properties that are persisted to the aspnet database even if the user hasnt actually truly registered.
    • stick an XML bag representing an order into session. This is persisted in the database with a regular identity ID.
    • store the ID of the cart in the ASP.NET Profile. that way when the session expires you can just reload it from the ID in the profile. this has the benefit that the user never sees the cart ID in a cookie and you can easily link records between the membership/profile database and the store you're using for your orders

    (dont try to store the XML order in the Profile. i think thats asking for performance issues. but in theory you could i suppose)

提交回复
热议问题