Shopping cart in OOP

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

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

Shopping cart in OOP

Post by thatsme »

Hello,

I am looking for a complete shopping cart tutorial from db design to checkout using OOP. Can anyone suggest me a book or a link which gives full tutorial.

Thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Have you looked through these tutorials ?
(#10850)
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

Post by thatsme »

Thanks arborint.

The link gives a lot examples.

As a beginner, i am looking for a tutorial which gives a clear explanations like, which are the methods should be in Base Class etc., etc.,. Too much of examples gives confusion.

Could you recommend a book.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Typically you have a Cart class and a CartItem class. You save the Cart object in the session and it contains an array of CartItems. Just start with addItem() and deleteItem() in the Cart and the start adding features to support actual products. Post some code and we can walk through the design.
(#10850)
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

Post by thatsme »

Thanks once again.

To start, the admin should add, edit, delete, view, list_view category, subcategory, product. Before doing these tasks he has to login. I also have to make configuration file for the site.

1. Should i have to make a separate class for sql queries?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

thatsme wrote:1. Should i have to make a separate class for sql queries?
It is a good practice to separate them into a Model class that only have dependencies on the data access layer below.
(#10850)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

thatsme wrote:To start, the admin should add, edit, delete, view, list_view category, subcategory, product.
No idea what you just said.
You lost me after 'add, edit, delete, view.'
thatsme wrote:Before doing these tasks he has to login.
I usually program the user system first (or very early on) since everything is based off of it.
thatsme wrote:I also have to make configuration file for the site.
Not necessarily. Unless you are programming locally and then switching it to a server later on, in which case it would make the switc as simple as editing the configuration file.
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

Re: Shopping cart in OOP

Post by thatsme »

the admin will be,

adding category, editing category, viewing category, deleting category, list_category
adding sub_category, editing sub_category, viewing sub_category, deleting sub_category, list_category
adding products, editing products, viewing products, deleting products, list_category
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Shopping cart in OOP

Post by Christopher »

I don't really consider that stuff to be part of the shopping cart (except the viewing ones). Those features are general CRUD pages in the admin area.
(#10850)
Post Reply