Welcome to WebmasterWorld Guest from

Forum Moderators: buckworks

Message Too Old, No Replies

PHP / Mysql Ecommerce Shopping Cart

Need help writing one...

11:44 am on Oct 25, 2005 (gmt 0)

5+ Year Member

Hi a client is wanting a shopping cart producing for his site and needs one built rather than an off the shelf piece of software.

I have never written a shopping cart script before so without wanting to spend hours stabbing in the dark pulling my hair out trying to figure it out I was wondering if anyone knew of some step by step help site or document that would give me the basic concept of how a cart works so I can write one.

Obviously URL's are not permitted here so message me them if you have them, if anyone has a simple to use script they can post excetpts from that would be usful also.

Many thanks in advance....

12:05 pm on Oct 25, 2005 (gmt 0)

5+ Year Member

writing a good shopping cart requires both good understanding of ecommerce and good understanding of php.

assuming you have both [otherwise pay someone to do it for you!], you might want to

1. separate design from code, use templates

2. keep a modular structure, easy adding and modifying modules

3. don't do to your user what you don't like others to do to you

and i could go on and on

12:05 pm on Oct 25, 2005 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

You could D-load a bunch of (Free) scripts
and do a "Post Mortem" on them
Since you never wrote one of your own then you need to learn how it works.
Please, do not be offended by the following:
You will need to be MySQL and PHP plenty fluent :)
4:50 pm on Oct 25, 2005 (gmt 0)

10+ Year Member

Writing a custom shopping cart with no experience in the ecommerce area is a (very) bad idea. Either subcontract it out or convince your client to go with an OTS solution. It's actually quite complicated and requires nearly continuous development to maximize conversion and usability.
6:39 pm on Oct 25, 2005 (gmt 0)

5+ Year Member

Of this im aware thank you. The port mortem idea was one I was going to stay away from but writing the scripts itself isnt too much of a problem. I could probably sit down for a week and have a working beta.

I suppose my question should really of been: what problems am I likely to run into when writing one...

Security issues etc...

Myself and the client want one I write for the security reason as it means I can patch it up based on my server config so there are no holes in it...

7:15 pm on Oct 25, 2005 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

The security issues will depend upon your setup. There are different exploits for the different levels of PHP.

Performance issues will be another concern. If your store gets busy, will it handle the traffic? Use OOP where appropriate and optimize your MySQL calls (or whatever db you're going to use).

TEST TEST TEST TEST TEST TEST ... benchmark the heck out of your setup and try all of the know hacks you can locate.

7:52 am on Oct 26, 2005 (gmt 0)

5+ Year Member

4:17 pm on Oct 26, 2005 (gmt 0)

10+ Year Member

why reinvent the wheel?
so many shopping carts out there, but everyone wants to invent their own ..........