Link to home
Start Free TrialLog in
Avatar of scm0sml
scm0sml

asked on

best way to code a basket

Hi,

I'm just about to start developing my first e-commerce basket and will be using .net 4.

I'm wondering if there is a "standard" way of doing it these days?

Do I use cookies, sessions or something else?

Presumably upon adding an item to the basket it just gets stored with a "basket or session id" and then it is the basket or session id that is available on all pages to pull up the basket?

I'm just looking for a basic overview of the best way to do things to ensure the session can't be lost and where I am not going to come up against issues with cookies disabled etc.

Would appreciate your thoughs and guidance...
Avatar of MikeMCSD
MikeMCSD
Flag of United States of America image

A sessionID (that uses cookies) could be used to track the user and you can store the cart items in the database.


You can take a look at this free open source shopping cart that uses .net 4 :

   http://www.nopcommerce.com/default.aspx

It's a pretty good system that I am currently using for web stores.

If you want something a little less complex and in Visual Basic,
you could take a look at this book that has good shopping cart code :

  http://www.amazon.com/Beginning-ASP-NET-1-1--Commerce-Professional/dp/1590592549/ref=sr_1_5?s=books&ie=UTF8&qid=1319387228&sr=1-5

You can buy it used for $0.08.
I actually used this book to build an ecommerce website that did very well
and was making about $500,000.00 a year.
Basically a shopping cart can be reduced to several pages all using Session Varaibles, response.redirect("review.aspx"):

Product Page
>>lists details of product and allows users to choose to put in shopping cart
Shopping Cart
>>Shows all products desired to be purchased, allows the user to manage list
Purchase Page
>>usuallty a purchase page that sums up the total dollar amount(thats all the merchat cares about), onClick redirects them to purchase page
    will they enter credit card info.  You would find fields such as email addres, name, dropdownlist  of states, credit card number(you can only use last 4 digits on web form)
Review Page
>> after the user enters details, they can confrim and submit order to merchat processor
On Complete Order page
>>most use an API like authorize.net, if there are errors, return an error code, other wise reward teh user with a confirmation order page and manage their accounts, ie get free point on database
   
ASKER CERTIFIED SOLUTION
Avatar of scm0sml
scm0sml

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scm0sml
scm0sml

ASKER

used my own answer...