Designing a 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
liveman
Forum Newbie
Posts: 3
Joined: Tue Jan 18, 2011 4:15 pm

Designing a Cart

Post by liveman »

I am a web designer and mostly use scripts to do a lot of my work, occasionally I change a few lines of code. Anyhow I am starting to get into the php side more it was a choice between ASP.NET or PHP I choose php because it seems to work more seamlessly and most of the resources are free.

I recently started editing a software package called JCart, it's a php shopping cart using AJAX and works very well, however it is a bit over-simple for what I wanted because I wanted to also use an SQL database and some of the code seemed a bit all-over the place.

So my solution was to develop my own system using PHP/MYSQL. I have a bit of experience with PHP just nothing major and I find it pretty easy to use.

Today I have created the index page, it queries the database and displays the products by printing each row. My next challenge will be to add these products (all virtual) to the checkout and then eventually perform a Paypal IPN check before the user is issued the virtual product via E-Mail.

I want to do all this using as little Javascript as possible... any guidance ?

Thanks in advance for any tips ;)
gooney0
Forum Commoner
Posts: 56
Joined: Fri Jan 21, 2011 1:40 pm
Location: Reston, VA

Re: Designing a Cart

Post by gooney0 »

I'd would suggest two things before you get too far along.

#1) Play with other carts and make notes of the features and design elements you need to include in your project. Map it out so you understand the overall process of things.

Example: Buying an item

Click "add to cart" -> Shopping Cart page -> Checkout -> Enter data

Example: Add a new product to system

Add new product -> Product info form -> Choose categories for product

Having this mapped out will also help you break the project into bite sized pieces.

#2) Data storage. Setup your database and tables. Double check your relationships. (one to one, one to many, etc.) Make notes on how you will store data in PHP.

Its very helpful to have a cheat sheet describing arrays and object you can refer back to latter while coding.


None of this needs to be overly fancy. A few simple text documents will usually do the trick.
Post Reply