PDA

View Full Version : writing my own simple ecommerce system


krisleech
03-10-2005, 11:40 AM
hi ya - i have started to write my own shopping cart / checkout script in php. I just wanted to run my methods past anyone to see it sounds an ok way to do it.

I have a products page which is generated from "products" table which includes add to cart links for each product: cart.php?action=add_item&id=3

The cart generates a unique ID and stores to a cookie, so that the cart / user can be tracked over multiple pages.

All products added to the cart are stored in "cart" table with the unique ID. The other action of the cart, remove, removes a product, quantity can also be updated.

This is the bit i am not so sure on:

At the checkout i have a form with the shipping/billing details. The button for the form opens savedata.php
savedata.php takes the auto-registered superglobals from the form and posts them to the "orders" table. They can then press next and are taken to a secure payment page (not hosted by us).

Any comments would be great, K.

PS. It is supposed to be really simple. I tried oscommerce, Zen cart etc. and they are all overkill. I have also built shipping options in to the system. I am also not great at php, i but am good at delphi/pascal.