"Check out" code for an ASP-built e-commerce site

Results 1 to 2 of 2

Thread: "Check out" code for an ASP-built e-commerce site

  1. #1
    Join Date
    Dec 1969

    Default "Check out" code for an ASP-built e-commerce site

    Hi all,<BR>Would anyone happen to have ASP code to put through an order on an e-commerce web site? (i.e. when someone clicks on check out after adding items to the cart? I have an orders table and an "order_product" table. I want to create the order and then take that order number and enter an item into the order_product table with that order number for each item in the order. I&#039m getting stuck and i&#039m wondering if anyone has this code? How does one accomplish associating many items (such as products)with one item (such as an order number)? I&#039m using an access database for now.<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Check out" code.

    You&#039ve really got 2 issues here. Issue 1 is the database design issue for associating ONE order TO MANY order-items.<BR><BR>Basically to achieve this you simply need a field in your [order-product] table that contains the order number.<BR><BR>Then you can create a one to many relationship between the [orders]![orderID] and [order-product]![orderID].<BR><BR>The second issue that you have is "how to check out?". I&#039m sure that there are many fine articles covering this subject, but it&#039s pretty simple really.<BR><BR>&#039Checking-out&#039 a shopper is basically the process of validating all information that the user has given you and inserting it into your database.<BR><BR>Lets say that we need the following information:<BR><BR> Name, Address, State, Country, Postcode, Credit Card Number,<BR> Credit Card Expiry, Amount of purchase.<BR><BR>Then the checking-out process in this case is:<BR><BR> Has the user entered a Name?<BR> Has the user entered an Address?<BR> Has the user entered a valid State?<BR> Has the user entered a valid Country?<BR> Is the credit card a valid credit card number?<BR> Is the expiry date a valid date and a future date?<BR><BR>Then, if all that data is valid, insert and update the data in your [orders] table.<BR><BR>For a basic shopping cart style database you would need the following tables:<BR><BR> THE ORDER PROCESS<BR> ----------------------<BR> Orders (each Order is akin to a Basket)<BR> OrderItems <BR> Shoppers<BR> Payments<BR> <BR> THE PRODUCTS<BR> ----------------------<BR> Products<BR> Departments<BR> Department_Products (Link Table)<BR> <BR>These would do for a minimum spec. database, but you get the idea.<BR><BR>If you have any difficulty with these concepts or would like some *actual* sample code then shoot me an e-mail.<BR><BR><BR>HTH<BR><BR>Darren<BR>[ darren@showusyourcode.com ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts