shopping cart

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

shopping cart

Post by thatsme »

I want to make a simple shopping cart using oop.

The table structure is:

category
cat_id
cat_name

sub_category
sub_cat_id
cat_id
sub_cat_name


product
sub_cat_id
product_id
product_name
product_qty
product_price
product_image


size
size_id
size_name

member
member_id
member_name
member_name
member_country
member_state
member_city
member_zip
member_address

cart
cart_id
product_id
size_id
qty


order
member_id
order_status
order_date


As this is the first attempt in OOP, i am not sure which method should go to which class?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Define your classes, then we may be able to help further.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

I'm no OOP expert (in fact, just beginning)

I'd start with a base class with a method to addItem()
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

Post by thatsme »

Class category
{
function addCat($cat_id)
{
//add or edit depending of the existence of cat_id

}

function delCat($cat_id)
{


}

function listCat()
{


}

}

same pattern repeats for sub_category, product, size, member

This is how i am planning to start
Post Reply