I've finished an initial version of the wish list module, and I'd appreciate suggestions from the community on directions for future development.
To install it:
1. Download the uc_wishlist.tgz attachment to this comment.
2. Extract the contents into the Ubercart directory. (This will create a uc_wishlist subdirectory).
3. Patch uc_cart.module with included update: From the uc_cart directory, run patch -p0 < ../uc_wishlist/uc_cart.patch
This has been tested with Ubercart Alpha 7d, 7e, and a recent Bazaar version.
These are some issues that came up in development:
I wanted to make the module as self-contained as possible so that little patching of other Ubercart modules would be required. For example, I added the 'add to wish list' buttons next to the 'add to cart' buttons by altering uc_product_add_to_cart_form, catching the form, and resubmitting it if the intended operation was to add to cart. However to automatically add the recipient's address to the shopping cart checkout form, it seemed preferable to make a patch for uc_cart rather than creating an alternate handler.
The number of products purchased from a user's wish list is tracked through a uc_order hook. When an item is added to the shopping cart from a wish list, extra information (the wish list and wish list product id) is added to the data array. Then when an order is completed (when the order status becomes pending) the order is scanned for items that came from a wish list. If any are found, their corresponding wish list products are updated, adding the order id, order product id, user id, and timestamp to the purchase field in the wish list products table.
I would like to see a central way of handling and accessing address data. I had to leave a fair amount of panes, css, and js code from uc_cart behind to provide this module's own address interface.
The module introduces two new tables (schemas updated from above):
{uc_wishlists}
wid (int) -- wish list id
uid (text) -- user id or session id
title (text) -- wish list title
date (int) -- event date/deadline
address (text) -- delivery address
{uc_wishlist_products}
wpid (int) -- wish list product id
wid (int) -- wish list id
nid (int) -- product node id
qty (int) -- quantity wanted
changed (int) -- timestamp of last modification
data (text) -- serialized array of product attributes and data
purchase (text) -- serialized array of purchase records
| Attachment | Size |
|---|---|
| uc_wishlist.tar.gz | 14.96 KB |



Joined: 10/02/2007