WordPress Cart Copyright 2005, 2006 Dave Merwin and Michael Calabrese (email : dave@madeblue.com m2calabr@dunamisdesign.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA URI: http://www.wordpresscart.org Description: This plugin add a shopping cart system to wordpress. There is an install script that adds some tables to the database that must be run first before using this plugin. If you are looking for some help with the plugin please goto: wordpresscart.org. This is a collaborative project by Made Blue (madeblue.com) and Dunamis Design (dunamisdesign.com). Authors: Dave Merwin (Made Blue) and Michael Calabrese (Dunamis Design) Authors URI: http://madeblue.com http://dunamisdesign.com Version: 0.9.1 Introduction ============ This plugin is a shopping cart for the Word Press system. It was built as a quote system for a company that generates a quote, gets the customer approval, then they process the order. It is setup that a post can be a item that can be sold, if it has marked as so. Installation ============ You can extract the tar file into the wp-contents directory. This will put the plugin into the plugins directory and the theme WPC into the themes directory. Next login to the admin of your site and enable the shopping cart plugin. Set your theme to the WPC theme. Edit any options that you need to change in under the Cart | Options Page. Notes ===== This plugin requires extra templates to be available. That is why we have included the WPC template. If you have your own template, see how we setup the current version. See Reuired Special Templates below. Required Special Templates ========================== cart.php This is the main display of the shopping cart. When you are doing anything with the cart you are currently sent here. admincart.php The is the admin view of the whole order, very much like cart.php but more options. cart_conf.php This is the confirmation page (which has been setup to be linked from an email). Here the customer is expected to check to see if the order is correct and approves of the prices. Here the customer can put in their email. cart_conf_error.php If for some reason someone tries to go to the confirmaton page and has something thing wrong, this is the page displayed. login_error.php Currently the system is setup that you must be a registered user to add something to the cart. So this is the page that is brought up, if your are not logged into the system and try to add something to the cart. thankyou.php This is displayed with a customer click on making what is in their cart into a quote. Creating a Link to Add an Item the Cart ======================================= The key is sending the post id and "addcart=1" as a link to the site itself and the shopping cart plugin will take over. For example: add to cart Displaying the cart/Using the $cart object. =========================================== The cart object ($cart) can be used in any template. It is passed as a global so all main templates, like index, see it with out any special effort. Any template that is called as a function from a main template (e.g: get_header(), get_sidebar(), get_footer() ), you will need to add a "global $cart;" at the top of the template. See sidebar.php as an example. Once you have access to the cart object, you can see if the user has a cart available to them use call: $cart->is_available(). You can set through the items in the cart by calling $cart->cart_item(). This function returns an object with the row data in it. The current attributes are: +----+---------+---------+----------+-----------+-------+-------+ | ID | cart_id | post_id | quantity | map_price | price | notes | +----+---------+---------+----------+-----------+-------+-------+ You can step through all of the items using code similar to the following: $cart_total=0;$tbody='
| '.$row->quantity.' | '; $tbody .= ''.$row->post_title.' | '; $tbody .= '$'. $row->map_price .' | '; $tbody .= '$'.$row->map_price*$row->quantity .' | '; $tbody .= '