Here is a little wobject I threw together in the last few days. I hope you like it. :)
You can look at a working version on my development site: http://webgui.kahncentral.net/examples
There are many features; most are what you'd expect in a shopping cart package:
You can discuss this wobject in the discussion forum here.
# Installation Instructions #------------------------------------------------------------------- # WARNING: Be sure to read the important warnings below before using # this wobject! #------------------------------------------------------------------- 1. Download webgui-shopping-cart-1.0.tar.gz and move it to your WebGUI directory. 2. Unpack the tar file: # tar zxvf webgui-shopping-cart-1.0.tar.gz 3. Several additional Perl modules must be installed: # perl -MCPAN -e 'install Locale::Country' # perl -MCPAN -e 'install Business::Shipping' # perl -MCPAN -e 'install Business::PayPal' # perl -MCPAN -e 'install Business::PayPal::IPN' Business::Shipping requires many other Perl modules, some of which may not want to install correctly. If CPAN fails to install these modules automatically, you need to manually install them: Class::MethodMaker Crypt::SSLeay Digest::SHA1 XML::DOM XML::Simple 4. Create the ShoppingCart database tables and populate the necessary data by executing the create-ShoppingCart-1.0.sql script: # mysql -uwebgui -ppassword WebGUI < docs/ShoppingCart/create-ShoppingCart-1.0.sql 5. Add an entry to the wobjects line in your etc/WebGUI.conf file for this wobject: wobjects = Article, ..., ShoppingCart, ... 6. Restart the web server. 7. Add a Shopping Cart from the Add Content... menu. Please see the online help for more information on form options. #------------------------------------------------------------------- # WARNINGS #------------------------------------------------------------------- 1. To use the PayPal IPN feature, you must disable visitor caching of the page you place your shopping cart on. Edit the page's properties and set both the Cache Timeout and Cache Timeout (Visitors) to 10 seconds or less. There is a bug in WebGUI <= 5.5.3 that ignores the visitor cache setting which is why you must set both values. If you fail to properly set the cache timeout, PayPal IPN will fail to process random IPN's and you will probably lose order data! 2. This wobject has only undergone fairly quick development testing. You should thoroughly test your shopping cart before using in a live production environment. As with all open source software, there is no warranty and use of this wobject is at your own risk. You can test PayPal by creating a second account separate from your business account and send small dollar payments to yourself. You can then refund the payment from your business account and not incur any fees! 3. Make sure that the values for "Shipping Plugin" and "Shipping Plugin Template" match, or your shipping form will not work properly. #------------------------------------------------------------------- # Optional Installation Instructions #------------------------------------------------------------------- To use the UPS shipping calculator, you will need to sign up for a free UPS account and receive an XML Access Key. Sign up at: https://www.ups.com/servlet/registration?loc=en_US_EC Once you have a user account, select "Get Access Key" and "Get XML Access Key" to obtain your access key. Enter your information on the "Edit Shipping Plugin Options" page. #------------------------------------------------------------------- # Future Enhancements #------------------------------------------------------------------- Here are some things that may be added in the future. I basically just ran out of time to implement them all in time for the contest deadline. :) * Allow an override shipping charge on individual products. * Allow a custom handling fee that is added to the shipping charge. * Support for sales tax/VAT. * US Postal Service shipping plugin using Business::Shipping. * Companion macro that displays the current cart contents. * Manual merchant plugin. The customer enters all address and credit card data via a secure SSL form, and an email is sent to the shop admin who comes back to view the order via SSL). #------------------------------------------------------------------- # Uninstallation Instructions #------------------------------------------------------------------- 1. Remove ShoppingCart from the wobjects line in etc/WebGUI.conf. 2. Remove the ShoppingCart database tables and all supporting data by executing the delete-ShoppingCart-1.0.sql script: # mysql -uwebgui -ppassword WebGUI < docs/ShoppingCart/drop-ShoppingCart-1.0.sql This will erase all traces of the ShoppingCart from your system, including all orders! Make sure you know what you're doing! 3. Remove the following files/directories: docs/ShoppingCart lib/WebGUI/Wobject/ShoppingCart sbin/Hourly/DeleteExpiredShoppingCarts.pm www/extras/ShoppingCart