SunQuest
           Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old December 10th, 2002, 04:52 PM
JavaReb JavaReb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 350 JavaReb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 6 h 42 m 45 sec
Reputation Power: 6
Send a message via AIM to JavaReb
Database design - ordering without signing up

Ok lets say im building a online shopping site. For the database I have the following tables (in addition to others)

orders

CUSTOMER
shopper_id
f_name
l_name
email
password
register_date
modify_date
shipto_street
shipto_city
shipto_state
shipto_zip
billto_street
billto_city
billto_state
billto_zip

ORDER
order_id
shopper_id
total
status
date_entered
date_changed

ORDER_ITEMS
order_id
sku
quantity
adjusted_price


my question then becomes, how do you handle orders for anoynomous users ? if your going to allow customers to buy without first registering (as is common now with many ecommerce sites), then you need some kind of anyonomous guest user account and maybe store at least the shipping info in the orders table


comments/suggestions appreciated

Reply With Quote
  #2  
Old December 11th, 2002, 09:19 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 13
Send a message via AIM to rod k
You're thinking about this the wrong way. The cart is not the same as the order. You need a seperate table then those listed to hold the cart UNTIL the order is placed. This can be related to the annonymous user by a random identifier (such as an MD5 hash). When the person places the order and you've gathered their personal information including billing data, then you move the cart to the orders table.
__________________
FSBO (For Sale By Owner) Realty

Reply With Quote
  #3  
Old December 11th, 2002, 11:01 AM
JavaReb JavaReb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 350 JavaReb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 6 h 42 m 45 sec
Reputation Power: 6
Send a message via AIM to JavaReb
items

thanks for the help, futher questions if i may:

ok, so how to store items in the basket ? im thinking of having an almost identialca set of tables for the basket as the orders - in otherwords, since i store order items in a seperate table from the order itself, the basket would need a similar structure , correct ?

Reply With Quote
  #4  
Old December 11th, 2002, 11:11 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 13
Send a message via AIM to rod k
Right. In addition to:

ORDER
order_id
shopper_id
total
status
date_entered
date_changed

ORDER_ITEMS
order_id
sku
quantity
adjusted_price

I'd have

CART
cart_id
date_entered
date_changed

CART_ITEMS
cart_id
sku
quantity
adjusted_price

I wouldn't put a total in ORDER or CART. That's a function of the total from CART_ITEMS and therefore redundent and an opportunity for corruption/discrepency.

Reply With Quote
  #5  
Old December 11th, 2002, 12:34 PM
JavaReb JavaReb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 350 JavaReb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 6 h 42 m 45 sec
Reputation Power: 6
Send a message via AIM to JavaReb
total

yep, thanks for the tip on total, that makes sense

BTW - im using a database aproach to building a shopping cart versus using code. In the past ive used ASP and session objects and recently ive used JSP and javabeans to build a cart. I want to use a set of database tables and index into the tables with a cookie, versus having a bunch of objects in memory


also - im going to be selling hard to find "Confederate wearables"

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Database design - ordering without signing up


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway