November Happy Hour will be moved to Thursday December 5th.

Multiple wish lists for a customer

Vote:
 

I am trying to implement multiple wish lists for a customer according to this example. It seems it's possible but in such a way that all instances of ICart must have "WishList" as a common name. 

Is there a clean way of attaching arbitrary name to the wish list so that wish list is attached to the customer only by customers ID or is there any other way to name wish lists as customer wants them to be named?

#189856
Mar 26, 2018 15:46
Vote:
 

Carts are unique per market, customer and name. Seeing as the customer is a part of that, I don't see too much risk with just letting the customers name of their wishlist be used as the cart name. Make sure you don't allow them to create cart names that you have reserved, f.ex. "Default" :P. And then when you list wishlists, you just query carts from that customer where the name isn't in the reserved list of names (i.e. "Default").

#189858
Mar 26, 2018 16:01
Vote:
 

A customer can have multiple carts in a market, as long as they have different names. However this is where things get tricky. A lot of code in Commerce assumes that you have only one wishlist, and that's default to "WishList". One of the examples is the "Abandoned cart removal job", which only allows you to specify one cart name to be excluded. So if you have WishList and BuyingList for example, BuyingList will likely be deleted when you run the job. 

#189859
Mar 26, 2018 16:11
Vote:
 

Luckily enough, that's a quite simple job. I'd still go with this route and instead build a custom scheduled job that takes this into account. Other options is either looking at completely different way of storage, which I believe to be a tougher job, or have the one wishlist, but add metafields to lineitems telling which wishlist they belong to. Depending on how big all your wish lists are together, that might be a performance issue. Then again, loading several carts (wish lists) isn't very fast either, unless you use ISerializableCart.

#189879
Mar 27, 2018 8:33
Vote:
 

What requirements do the customer have?

My initial aim would be to keep everything in the same Cart/OrderGroup named "WishList" and divide the contents into different OrderForms to give the illusion of seperate wishlists.

That is how i would want to store it, then build custom on top of that to fulfill the customer's wishes about how it should be displayed on the site.

#189929
Mar 27, 2018 14:52
Vote:
 

Then you would have to load all the wish lists at the same time though. But yeah, there are several approaches, they come with different pros and cons I suppose :)

#189932
Mar 27, 2018 15:08
Vote:
 

The requirement is to have multiple wish lists with one listing page where only the names of the wish lists would be displayed as links. When visitor clicks on the wish list name it would take him to the wish list page with only items present in that specific list. Every product should have a drop down menu with all the possible custom lists created so far so that product could be placed or removed in or from many lists by toggling the check box next to the wish list name.

I will check both approaches to see what are the cons and pros :)

#190175
Apr 04, 2018 9:23
Vote:
 

I eventually went with multiple order forms in a same wish list. 

#190382
Apr 10, 2018 13:11
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.