Webforce Cart 1.6
Sponsored Links
Webforce Cart 1.6 Ranking & Summary
File size:
0.003 MB
Platform:
Any Platform
License:
LGPL (GNU Lesser General Public License)
Price:
Downloads:
942
Date added:
2007-04-06
Publisher:
Webforce Ltd
Webforce Cart 1.6 description
Webforce Cart (wfCart) is a free PHP shopping cart class you can use a component of a PHP based online store. Its designed as a component for PHP developers who would rather write their own store rather than a complete solution.
Instructions and examples for the free PHP Shopping Cart
To use the cart in an existing script:
Rename wfcart.php.txt to wfcart.php and upload to your server.
Then include the file:
include("wfcart.php");
Start the session, and assign the cart to it. NOTE: You must include the file wfcart.php before you start the session, its just the way PHP works.
session_start();
$cart =& $_SESSION[cart];
if(!is_object($cart)) $cart = new wfCart();
Then you can use the functions like $cart->get_contents();, these functions are documented below.
Adding an Item - $cart->add_item( code , quantity , price , info )
If you have a widget with code AB313 and a price of $40.11, you can add it to the cart with :
$cart->add_item(AB313,1,40.11,Widget AB313 Standard);
If the item AB313 is alreay in the cart, then the quantity of it will be increased by the quantity supplied to the function, in this case 1. The itemid must be unique, and can be letters and/or numbers.
Deleting an Item - $cart->del_item( itemid );
E.g. to delete the item ID 123
$cart->del_item(123);
Changing the quantity of an item -
$cart->edit_item( itemid, new_quantity );
For example :
$cart->edit_item(HA2,3);
If you set the quanitity to zero, the item is deleted.
Getting the number of items in a cart
echo $cart->itemcount;
Getting the total value of the cart.
echo $cart->total;
Emptying the cart
$cart->empty_cart();
Getting the cart contents
$items = $cart->get_contents();
$items is an array, so the following code displays the items.
foreach($items as $item) {
echo "Code/ID :".$item[id]."
";
echo "Quantity:".$item[qty]."
";
echo "Price :".$item[price]."
";
echo "Info :".$item[info]."
";
echo "Subtotal".$item[subtotal]."
";
}
Note, subtotal is quantity X price for that item, not a running total..
Extending Webforce Cart
There are 2 functions you can create that will enable more flexability.
One is wf_get_price( itemid, qty ). If you need to do pricing based on Quantity ( e.g. bulk discounts ) then you can create a function called wf_get_price to do what you need itto do. If you do not pass a price to add_item, then the wf_ get_price function will be called. If you use this functionality, AND your price is quantity dependant, then you must uncomment the line in the edit_item function.
The other is wf_get_info, again, if you do not pass info to add_item then get_info will be called. TIP: you do not have to pass a string to add_item(), you could use an array of infomation instead. e.g. add_item( AS2112,5,19.95,array(size=>large,color=>red)); then when you use get_contents, you echo $item[info][color] etc.
Enhancements:
- The empty cart function was fixed.
Instructions and examples for the free PHP Shopping Cart
To use the cart in an existing script:
Rename wfcart.php.txt to wfcart.php and upload to your server.
Then include the file:
include("wfcart.php");
Start the session, and assign the cart to it. NOTE: You must include the file wfcart.php before you start the session, its just the way PHP works.
session_start();
$cart =& $_SESSION[cart];
if(!is_object($cart)) $cart = new wfCart();
Then you can use the functions like $cart->get_contents();, these functions are documented below.
Adding an Item - $cart->add_item( code , quantity , price , info )
If you have a widget with code AB313 and a price of $40.11, you can add it to the cart with :
$cart->add_item(AB313,1,40.11,Widget AB313 Standard);
If the item AB313 is alreay in the cart, then the quantity of it will be increased by the quantity supplied to the function, in this case 1. The itemid must be unique, and can be letters and/or numbers.
Deleting an Item - $cart->del_item( itemid );
E.g. to delete the item ID 123
$cart->del_item(123);
Changing the quantity of an item -
$cart->edit_item( itemid, new_quantity );
For example :
$cart->edit_item(HA2,3);
If you set the quanitity to zero, the item is deleted.
Getting the number of items in a cart
echo $cart->itemcount;
Getting the total value of the cart.
echo $cart->total;
Emptying the cart
$cart->empty_cart();
Getting the cart contents
$items = $cart->get_contents();
$items is an array, so the following code displays the items.
foreach($items as $item) {
echo "Code/ID :".$item[id]."
";
echo "Quantity:".$item[qty]."
";
echo "Price :".$item[price]."
";
echo "Info :".$item[info]."
";
echo "Subtotal".$item[subtotal]."
";
}
Note, subtotal is quantity X price for that item, not a running total..
Extending Webforce Cart
There are 2 functions you can create that will enable more flexability.
One is wf_get_price( itemid, qty ). If you need to do pricing based on Quantity ( e.g. bulk discounts ) then you can create a function called wf_get_price to do what you need itto do. If you do not pass a price to add_item, then the wf_ get_price function will be called. If you use this functionality, AND your price is quantity dependant, then you must uncomment the line in the edit_item function.
The other is wf_get_info, again, if you do not pass info to add_item then get_info will be called. TIP: you do not have to pass a string to add_item(), you could use an array of infomation instead. e.g. add_item( AS2112,5,19.95,array(size=>large,color=>red)); then when you use get_contents, you echo $item[info][color] etc.
Enhancements:
- The empty cart function was fixed.
Webforce Cart 1.6 Screenshot
Webforce Cart 1.6 Keywords
PHP
Webforce Cart
AB313
Webforce Cart 1.6
php shopping cart class
php shopping cart
php shopping
can use
shopping cart
PHP based
Online Store
cart
item
WebForce
price
quantity
Bookmark Webforce Cart 1.6
Webforce Cart 1.6 Copyright
WareSeeker periodically updates pricing and software information of Webforce Cart 1.6 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Webforce Cart 1.6 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
php shopping cart tutorial
php shopping carts
php shopping cart software
php shopping cart script
php shopping cart code
php shopping cart open source
php shopping cart reviews
shopping cart hero
quantity cooking recipes
priceless
open source php shopping cart
fisher price
quantity surveying
webforce inc
simple php shopping cart
quantity surveyor jobs
priceless420
carter lumber
Related Software
Zen Cart truly is the art of e-commerce; a free, user-friendly, open source shopping cart system. Free Download
OpenCrypt is the most flexible, customizable, powerful, secure and of course easy to use membership/user management software. Free Download
Web Site Robot is an easy to use Web site builder with a blog tool. Free Download
IdeaCart is an Open Source shopping cart based on PHP and MySQL Free Download
DB_cart Class is a MySQL shopping cart script that can be used with third party product catalogues and membership systems. Free Download
AFCommerce is a full and complete online store with both a storefront and administration area, which can be easily installed, configured, and maintained over a web-based interface. The source code is Free Download
Quick.Cart is a freeware and simple e-commerce solution designed for your own web shop administration. Free Download
Freeblisket provides a set of tools for creating e-commerce Web sites. Free Download
Latest Software
Popular Software
Favourite Software