By the way, i did call this tutorial as a shopping cart tutorial but actually we're building an online shop ( a really simple one ). The shopping cart is just part of the shop. But because the term 'shopping cart' is already common to define an online shop solution i just use it instead of naming this site a 'PHP MySQL Online Shop Tutorial'.
I have to assume that you already know about PHP and MySQL so i won't explain every code in detail. The codes are not too complicated though, i'm sure you can understand it. I suggest you download the code first so you can run it on your computer. That way it's easier for you to understand this tutorial
If you don't want to download the code that's fine but make sure you take a look at the demo site, this is what our shopping cart willl look like.
After you browse around you will see that the basic flow of our shop is :
1. A customer visit the site
2. She browse the pages, clicking her way between categories
3. View the product details that she found interesting
4. Add products to shopping cart
5. Checkout ( entering the shipping address, payment info )
6. Leave ( hopefully to return another time )
Nothing complex here. The customer doesn't need to register for an account. She just buy then leave."
Features
Okay, here are the shop features ( or maybe i should call this restrictions )
- Flat shipping cost.
No complex shipping calculation for this shop right now and i don't have any plan to change this in near future.
- Payment processing using Paypal
For now this shop can only handle payment through Paypal IPN. The reason i pick paypal is because they provide excellent resource for developers so i can test the payment process easily.
- Configurable image and thumbnail size
You can restrict the product image width from the config file. You can also set the thumbnail width you want for all product images that you upload.