Shopping Cart V0.9
Release date Jul 1st 2006
(C) 2006 by G.Glendown
Released under GPL
Shopping Cart is a small package of PHP scripts/pages to help you keep a list of groceries (or what ever) you need to pick up. You can create a set of shops (or types of shops) that you usually go to, and a set of things you frequently pick up. Every item can be assigned to a certain store (or any store), and you can display the list of items to get either in total, or limited to a certain store you just happen to be at.
Shopping Cart was inspired by the Palm Pilot program "JShopper", which is a great little tool!
As I had handheld devices in mind when designing the user interface, it's pretty slim as far as display information is concerned. A typical list page will be around 2-4k in size, small enough to work comfortably over GPRS connections. Apart from some colors and regular form elements, no graphical stuff was used at all.
Shopping Cart is released under the GNU Public Licence. Do with it as you like, but if you decide to redistribute a new version, please at least keep my name & references to the original program intact ;) Also, improvements and fixes are always welcome, just let me know ;)
Installing Shopping Cart is pretty straightforward. Just drop all the files in a subdirectory on a webserver. You will need to create a database for it (or use an already existing one), e.g. like this:
$ mysql_admin -p -uroot create shopping
Enter the appropriate password to create the database. You should also create a user for this database:
$ mysql -p -uroot mysql> grant insert, update, delete on shopping.* to shop@localhost identified by "shoppw";
Once you have done this, get ahold of the file config.php and set the values for database server, database name, user and password accordingly. Then, import the database structure:
$ mysql -pshoppw -ushop shopping <shopping.sql
This will create the two tables used by Shopping Cart and adds an item and shop for testing. Both can be delete anytime.
Now, direct your browser towards the directory, if the Webserver is configured to display a file called "index.php", it should show the initial shopping list directly. If not, either update your webserver config, or add "index.php" to the URL.
That's it, you're done! :)
To start off with, you will need to define a set of shops by calling the page editshop.php from the server. It will give you a drop-down selection of all currently configured shops, as well as an entry line.
Shopping Cart uses Java Script to update the data displayed - on JS-enabled browsers, anytime you select an item from the drop down list, or update a checkmark on the main list, the form is submitted to the webserver and the new information is displayed. This may not be available on your handheld device. In this case, after selecting an item from the drop down, you will need to select the "Go" button prior to any other modification - Shopping Cart will not update or delete an entry if the data displayed is not from the same entry as the one shown in the drop down list. This manual will assume that your browser has working JS ...
To create a new shop, just enter its name in the "Shop:" line and select "New". Similarly, to change the name of a shop, select it from the drop down, modify it and select "Change". Items assigned to that shop will still remain assigned!
To delete a shop entry, select it and press "Del" - any items assigned to the shop are not deleted, but set to "any" shop. You can then re-assign them to any other shop.
To modify the list of items, handling is similar to the shop list. To create a new item, though, select "New" from the drop down list. This will clear the entry form so you can then enter a new item.
Apart from the item name, you can assign a certain store. This will let you later on get a specific list for a certain store you are just in, hiding grocery items while you're shopping in the local sports store. If the item should be listed on multiple stores, just select "any" here (which is the default). The isle entry lets you sort the items - on the shopping list, items are first sorted by this field, then by their names. If you do not enter anything here, "99" is used as a default. Finally, you can optionally enter a price for an item, which will be shown on the main list. This can be used to enter the regular price, allowing you to shop for any specials, or see how "special" a special really is ... Once you're done, press "Save" to store the entry. Same goes for editing an entry, once you selected the item, do any changes and again use "Save" to update the database.
Finally, to delete an item, select it and press "Del" - pretty much straight-forward ...
The main shopping list
Once you have set up the Shopping Cart with all your favorite items and shops, you're ready to go! The main window has a few static entry items as well as the list of the shopping items. On the drop down list, you can either select all shops, not limiting the items displayed to a certain shop, or select a single shop. While "all" is unchecked, only items selected to be bought are being listed, with an empty checkmark in front of them. Once you check an item, it is removed from the display (again, if your browser does not implement JS, you will have to select "Update" at the bottom of the page to submit the changes). By selecting the "all" checkmark at the top, handling and displayed items will change, the logic of the checkmarks is reversed. This mode is for making your shopping list. Here's a table (hopefully) clarifying what items are displayed with which setting:
|not checked||anything selected for buying in this store as well as items to be bought not assigned to a specific store||all items selected for buying
Items to be bought have a checkmark
|checked||all items assigned to this specific store - items not assigned to a store are not shown||all items
Items to be bought have a checkmark
Now, anything not checked is not on your "needed" list, while checking an item defines it to be bought.