4
votes

I am starting up a Commerce webshop.

I would like to add the Commerce wishlist, but now the module is working only with registered users, for unregistered it does not work.

I set the role in the display block to anonymous, but even after changing this, I get the message that I have to log in to add something to the wishlist.

Can someone please advise me how to change it for use of anonymous users? I'm using Drupal 7.

3
The wishlists are stored in the database against a user id, and since the anonymous user always has a uid of 0 you'd need to implement some sort of mechanism to track users based on (perhaps) a cookie. Of course, when a user clears their cookies, they'll lose the wishlist. The issue you're facing is at a higher level than the wishlist module (or even Drupal). Once you've found a way of identifying anonymous users correctly you'll be half way there. But I know that module and it would take a fair bit of work to re-jig it for those purposesClive

3 Answers

1
votes

The maintainer of commerce_wishlist module has just released the 2.x-dev now also supporting public wishlists. Furthermore social sharing of lists will be supported.

1
votes

By using the Flag module instead of the Commerce Wishlist module, you can take advantage of its facility to also display a flag to anonymous users. For that, refer to what's written in the community documentation of the Flag module, i.e.:

Flagging for anonymous users (even with page caching enabled) requires Session API.

Something similar from the README.txt:

Optional Installation

1) The ability for anonymous users to flag content is provided by the Session API module, available at http://drupal.org/project/session_api.

Be aware however that Session API isn't mentioned as a dependency in the Flag module either.

0
votes

Instead of Commerce Wishlist you can use Flag, this do the same and more flexible. Also this work with anonymous users and have prepared Views for showing in blocks/pages.