Wish list/gift registry module

Contrib type: 
Module
Status: 
Work in progress
Moderation: 
Not ready for moderation
Latest version: 
0.7
Compatibility: 
Ubercart 1.x
Compatibility: 
Ubercart 2.x

*** UC Wish List has been ported to D6 and completed by Ryan; available at http://drupal.org/project/uc_wishlist. ***

ABOUT

uc_wishlist is a module that adds wish list/gift registry support to Ubercart. This module has been tested with Ubercart 1.6.

INSTALLATION

Download the latest release of this module below. Uncompress the archive in your Ubercart contrib directory. Enable the wish list module under 'Ubercart - extra' in the Drupal module administration page.

FEATURES

This module enables users to create a gift list for use as a personal shopping list or a public gift registry. An 'add to wish list' button is added wherever there is an 'add to cart' button.

DETAILS

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, the source wish list is stored with the item. When a sale is completed (and the order state changes to post_checkout) the order is checked for items that came from a wish list. If any are found, the corresponding wish list items are updated, and information about the order (the order id, order product id, user id, and time) are added to the purchase field in the wish list products table.


PreviewAttachmentSize
uc_wishlist-0.7.tar.gz23.64 KB
Joined: 08/07/2007
Juice: 15046

Hey, glad to see this contribution pop up in the recent posts. Cool

I've put a few thoughts on the patch in the wish list thread.

Joined: 10/07/2007
Juice: 123

after updating to bzr 504 this morning i noticed this

warning: Invalid argument supplied for foreach() in /var/www/html/mix/modules/user/user.module on line 1519.
on this page
http://demo.example.net/user/1

i isolated the error down to the wishlist module. disabling it alone removes the error.

Mohammed Arafa

Joined: 10/02/2007
Juice: 126

Marafa,

Thanks for reporting that problem. It has been fixed in version 0.3.

Joined: 10/23/2007
Juice: 70

Hello,

I have the list in a block and it works fine there.

However, I get the below error when trying to view /wishlist with products in it. If the wishlist is empty I can view /wishlist with no trouble.

PHP Fatal error: Call to undefined function uc_address_field_required() in modules/ubercart/uc_wishlist/uc_wishlist_address_pane.inc on line 30

This occurs for both anonymous and authenticated users.

Have I missed something obvious?

Paul

Joined: 12/19/2007
Juice: 110

Just a note that I've made some fixes to 0.3 (mostly making it so it doesn't break the drupal search feature). The patch is on this issue.

Joined: 10/02/2007
Juice: 126

jrust,

Thanks for posting the patch. I've included those changes in the new version 0.4.

Joined: 10/02/2007
Juice: 126

The new release of uc_wishlist, version 0.5, includes bug fixes as well as user interface improvements:

-- added admin options: The administrator can now specify the default title of a wish list, and a token is provided for substituting the user's name. Also, there is an option for allowing anonymous users to create wish lists, which is now by default not allowed.
-- added administrator manage page for listing and deleting wish lists
-- rearranged the wish list page: There are 'add to cart' buttons next to each wish list item. The wish list settings have been moved to the top. Also, I added a notice for users who have not yet entered an address.

The admin settings and manage page are available through store configuration (admin/store/wishlist/settings and admin/store/wishlist/manage). After installing this release, you may need to flush your menu cache to access the new pages.

Joined: 03/09/2008
Juice: 6

Thanks it works great

Joined: 03/09/2008
Juice: 6

I have created a wish list for a user and in the Mailing address settings I have an address for in India and when I try to save it; this is the message I get

"An illegal choice has been detected. Please contact the site administrator."

Can i either disable it and let the users provide shipping address at checkout or somehow make it take international addresses.

BTW great module.

thank you.

Joined: 10/02/2007
Juice: 126

Version 0.6 includes bug fixes as well as user interface improvements:

-- on the wish list page, 'add to cart' buttons will add item even if the quantity has not been set
-- fixed bug causing error message about items from multiple wish lists
-- fixed bug that caused wish list items to not include shippable parameter (any items added to a wish list before this fix will not be marked as shippable. so you have to disable 'Hide shipping information when possible for carts with no shippable items.' in the checkout settings.)
-- added redirection back to page where user is prompted to login or register
-- added 'create or manage my wish list' link to search page
-- added CSS file for custom styles on wish list search page

Let me know how it works. Hope you enjoy.

Joined: 03/13/2008
Juice: 50

thank you detour.

I installed and tested it on beta. Works great. One thing if I could suggest is a report/notification to the list creator so that if someone buys him something on his list he gets an email with details as to who bought him what or a button under the manage wish list where he can click on it and see who bought him what..

Great work.

Joined: 04/17/2008
Juice: 7

Is there any way i could sort the items on the wishlist? Alphabetically perhaps, or by category?

Joined: 12/11/2007
Juice: 114

Does this module work for UC 1.0? I have installed it but I can't get anything to add to the wishlist. The button shows up and it confirms that it was added but then when you view the wishlist it does not show any products.

Thanks for your help.

Joined: 10/07/2007
Juice: 64

i was almost dreading writing this module all by myself, but i just got one-upped
Laughing out loud

thanks guys

Joined: 06/05/2008
Juice: 43

hi folks,
happy about that moduel i also tryed to get it on work in ubercart 1.0 but i also can not see anything in the list after creating one and trying to add some articles.

after the first creation i pressed the save button and got the following

error warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/ubercart/sites/all/modules/uc_wishlist/uc_wishlist.module on line 1376.

i pressed save again and the error did not show up again.

it would be a great help if detour would make this moudule ubercart 1.0 compatible and i would spend a box of beer to him !
thanks in advance

sunny days
carsten

Joined: 07/14/2008
Juice: 2

Hello ,

I can see my wishlist in navigation bar . But by clicking on "view wishlist", I can't see my wishlist. Help me

cathe

Joined: 10/07/2007
Juice: 64

I did this in about 15 minutes so suggestions are greatly appreciated if not encouraged.

I am using these hacks for demonstration that nothing is extremely wrong here.

<?php
/**
* Display a page allowing the customer to view his/her wish list.
*/
function uc_wishlist_view_form($items, $wid, $own) {
/***  TODO: FIX: $items was not being passed so we load them just like before in uc_wishlist_view()  */
if (!$items) {
 
$items = uc_wishlist_get_contents($wid);
}
 
$form['items'] = array('#tree' => TRUE);

 

$i = 0;
  foreach(
$items as $item) {
   
$item->module = 'uc_product';   /**** TODO: WORKAROUND: my objects were not showing $item->module so i injected it here */
   
$display_item = module_invoke($item->module, 'wishlist_display', $item, $own);
    if (!empty(
$display_item)) {
     
$form['items'][$i] = $display_item;
     
$i++;
    }
  }

  if ((

$page = variable_get('uc_continue_shopping_url', '')) != '<none>' &&
     
variable_get('uc_continue_shopping_type', 'link') == 'button') {
   
$form['continue_shopping'] = array(
     
'#type' => 'submit',
     
'#value' => variable_get('uc_continue_shopping_text', t('Continue shopping')),
    );
  }

 

$form['wid'] = array(
   
'#type' => 'hidden',
   
'#value' => $wid,
  );
  if (
$own) {
   
$form['own'] = array(
     
'#type' => 'hidden',
     
'#value' => true,
    );
   
$form['update'] = array(
     
'#type' => 'submit',
     
'#value' => t('Save wish list'),
    );
  }
  return
$form;
}
?>
Joined: 01/02/2008
Juice: 52

is possible when an user creat his wishlist,to assign a password (access code) so only his friends can see the list?

and also how name for the list owner's list can to decide a specific name and not his user name; this is some better also for example for not show own user name (used for login).

Example of use:
If the list is only pubblic and the site have many wishlists or/and there are user with similar name then the friends can make errors when they choiche the wishlist.
But if is required a code for access then will be open only the specific wishlist.

Joined: 03/15/2008
Juice: 68

Hi!

I made a little hack to give the user the ability to make the wish list private with a drop down box. I don't really know how to do patches, but hopefully it will be helpful to someone.

You need to create a new column in the {uc_wishlists} table, called private. (This is probably not the best solution, it should be included in the .install file)

The changes in uc_wishlist.module:

line 96
$res = db_query("SELECT DISTINCT w.wid, w.title FROM {uc_wishlists} AS w JOIN {users} AS u ON w.uid = u.uid WHERE u.name LIKE '%%%s%%' OR w.title LIKE '%%%s%%' OR w.address LIKE '%%firstname%%%s%%addr1%%' ORDER BY w.title", $query, $query, $query);

change to:
$res = db_query("SELECT DISTINCT w.wid, w.title FROM {uc_wishlists} AS w JOIN {users} AS u ON w.uid = u.uid WHERE w.private = '0' AND u.name LIKE '%%%s%%' OR w.title LIKE '%%%s%%' OR w.address LIKE '%%firstname%%%s%%addr1%%'  ORDER BY w.title", $query, $query, $query);

add this after line 1059:

$form ['ws']['private'] = array(
  '#type' => 'select',
'#title' => t('Make private'),
'#description' => t('Use this box to make your list private'),
'#options' => array( '0'=> 'No', '1' => 'Yes'),
  );

add this after line 1081:
$private = $form_values['private'];

change line 1097
uc_wishlist_update_wishlist($wid, $title, $date, $address);

to:

uc_wishlist_update_wishlist($wid, $title, $date, $address, $private);

change line 1269

$res = db_query("INSERT INTO {uc_wishlists} (wid, uid, title, date) VALUES (%d, '%s', '%s', %d)", $wid, $uid, $title, $date);

to:

$res = db_query("INSERT INTO {uc_wishlists} (wid, uid, title, date, private) VALUES (%d, '%s', '%s', %d, '%s')", $wid, $uid, $title, $date, $private);

change line 1276

function uc_wishlist_update_wishlist($wid, $title, $date, $address) {
//TODO combine with uc_wishlist_create_wishlist?
  $addrstr = serialize($address);
  db_query("UPDATE {uc_wishlists} SET title = '%s', date = %d, address = '%s' WHERE wid = %d", $title, $date, $addrstr, $wid);
}

to:

function uc_wishlist_update_wishlist($wid, $title, $date, $address, $private) {
//TODO combine with uc_wishlist_create_wishlist?
  $addrstr = serialize($address);
  db_query("UPDATE {uc_wishlists} SET title = '%s', date = %d, address = '%s', private = '%s' WHERE wid = %d", $title, $date, $addrstr, $private, $wid);
}

This got me up and running, please review it and let me know if it's a good and working solution.

Rob

Joined: 10/22/2008
Juice: 2

just curious if this module will work with ubercart 1.5 ...i saw the patch for 1.0 and am hoping this extends to 1.5
Has anybody had this running with 1.5?...
Looks like a great contribution to the ubercart family...
Thank you so much for your time in this...I really hope to use this feature

strawman

Joined: 08/18/2007
Juice: 132

Hi. Great module.

What would need to be adjusted in the module so that the default wishlist/search page does not show existing lists (prior to a search), but only the search field?

Another thought would be to make it so that successful searches require an exact match of the user name or email address. This may be enough to make lists private.

Thanks!

Joined: 10/02/2007
Juice: 126

Sorry for the delay in preparing this release. Version 0.7 fixes compatibility with Ubercart 1.x (thanks to c0psrul3) and includes some other changes.

I'd like to do more development on this module (see the included TODO.txt), but I don't currently have funding for it. Please contact me if you'd like to sponsor the development of any features.

Joined: 09/09/2008
Juice: 149

Does this wish list module support anon. users? (more specifically users who haven't signed up for an account on the shop site?)

Reason is:
http://virtualtruedating.info/portfolio/ubercart/node/4

When I try to add to wish list and i'm not logged in. It just adds products to cart and not to the wish list.

Joined: 09/09/2008
Juice: 149

last problem was fixed but i have a problem where wish list interferes with my ajax cart module. does anyone know whats going on there?

Joined: 05/22/2008
Juice: 163

Please check latest release of uc_ajax_cart .

Joined: 09/09/2008
Juice: 149

I posted a new critical bug with this module in the issues area.

Joined: 10/20/2008
Juice: 535

I have a question.

Can this be used to track what visitors are considering buying? IE can a UC administrator view the entire sites wishlist?

This would help us determine what our customers are "thinking" about buying but for some reason haven't purchased just yet. Maybe then, if a pattern or trend emerged, I would focus my marketing on those products to make them more appealing.

?

Mike

Joined: 01/09/2009
Juice: 26

Is it possible to have the wish list emailed. As i'm looking to have a enquiry only option to request samples or quotes.

Joined: 12/24/2008
Juice: 24

I'm not sure if this module has been ported to Drupal 6 but I'm working on that right now. I will upload it here when it works properly.

Joined: 03/19/2009
Juice: 23

Any news on the D6 port for this module? Smiling

Joined: 08/07/2007
Juice: 15046

Hey Sammy, I ported this for a client and will get it into CVS ASAP. Until then, you can give this zip file a go!

AttachmentSize
uc_wishlist_d6.zip 15.45 KB
Joined: 12/24/2008
Juice: 24

I was porting this module but I'm pretty sure Ryan did a better job hehe.

Thanks Ryan!

Joined: 08/07/2007
Juice: 15046

Sorry about that duplicated effort! I had this finished prior to Drupalcon DC but in all the hubbub wasn't able to post it up. Shocked

Joined: 08/07/2007
Juice: 15046

I added a project page at http://drupal.org/project/uc_wishlist for bug reports and feature requests. For some reason, it's not picking up on my 1.0 release tag, but the code is all there in CVS and will be packaged up as soon as it's recognized.

Joined: 12/04/2008
Juice: 17

The 'add to wishlist' button only appeared with 'buy it now' form on product page. In the products list page, the form is 'add to cart'. I think detail and list page both should add wishlist button. So i modified the code:

<?php
if (strpos($form_id, 'uc_product_add_to_cart_form_') === 0 || strpos($form_id, 'uc_catalog_buy_it_now_form_') === 0)
?>

If 'add to wishlist' button is intergrated in views, it will be flexible to use.

Joined: 08/07/2007
Juice: 15046

You should post that fix to the UC Wishlist issue tracker so it can be considered for inclusion in the module. Smiling

Joined: 10/03/2008
Juice: 272

Posted to drupal.org project page as well:

I have uc_wishlist installed in Drupal 6.x and UC 2.x. It's allowing me to create the wish list but when I login as a user, search for a wish list and then add one of that wish list's products to my cart I get the following errors:

* You have selected to purchase more items than requested.
* You have selected to purchase more items than requested.

Any suggestions? It's not adding to the cart and I do have a quantity set on the wishlist side. So I've added a quantity of 1 or more to the # of product I would like. But then logged in as a diff user and then trying to add that product it doesn't work per above.

-backdrifting

Joined: 10/03/2008
Juice: 272

Also - is there a method of adding a unique identifier such as a wish list # to this so that the wish list # is also searchable? So for example now you can search by name and address. How easy would it be to search by #?

-backdrifting

Joined: 07/06/2009
Juice: 52

Is it possible to add my own wish list button similar to uc_cart_links so I specify the exact attributes and there is a link to add it to the wish list?

Something like /cart/add/p1_q1_a1o2?destination=wishlist ?

Joined: 10/20/2008
Juice: 535

Hey cdeverapalli-

Did you ever figure this out? Sorry if I missed the fix somewhere. I just had a customer email me stating that he cannot select British Columbia as a providence for Canada in the Wishlist, which I verified myself as well.

Has this been fixed yet? I am using version 0.7. Has a newer version become available?

Thanks
Mike