PHP Super Simple Shopping Cart System
This is a very simple, yet fully functional shopping cart system programmed in PHP. Usage and integration is simple, no database required. At the moment, their is no payment module. This is only a shopping cart solution. Come back to Unibia.net for payment modules as I may add them in. Orders along with payment information is emailed.
The data structure is a multidimensional array. All the items are stored in an array (the shopping cart) which is stored in the $_SESSION variable. Each item is it's own array that keeps information such as the internal item ID, Quantity, Description, and Price. The end user never sees the internal item ID.
The shopping cart is managed by passing URI parameters as GET or POST requests. A POST request is used only to manipulate an existing item's quantity. The GET requests allow you to add an item, empty the cart, or remove a single item. Most of the time, the only method you will need to manual create is the item add URI. The other methods have GUI controls built in.
At minimum you must adjust lines 99 and 100 so you and your costumers can receive email notification about your orders.
<?php
$adminEmail = 'info@example.com';
$companyName = 'Unibia.net';
?>Next Upload the script to your PHP enabled web server. The file name does not matter just as long as your other pages link to the correct file.
Add products to the shopping cart with a simple HTTP "GET" request with the following URI parameters:
A request to add an item would look like this:
http(s)://www.{website}.com/{script file name}.php?add=ChopSticks&price=3.00&qty=1*Spaces are allowed in the products name.
Try it out at: http://www.unibia.com/unibia/dev/examples/SuperSimpleShoppingCart/
Download it at: http://www.unibia.com/unibia/dev/downloads/SuperSimpleShoppingCart.tar
