Wishlist for anonymous user in kentico 12sp MVC

harshal bundelkhandi asked on March 6, 2020 11:29

Hi Support, As currently we are using kentico 12sp with MVC to create the eCommerce website. As we have gone through the documentation for E-commerce .we are not able to add the products to wishlist items for the anonymous user.only for registered users it is adding the products. Can you please help me out. how can i add the product for Anonymous user in wishlist.

Thanks, Harshal

Correct Answer

Dmitry Bastron answered on March 6, 2020 12:54

Peter, it's not necessary. User is enough. In the code example you shared there is a "customer.CustomerUserID" which is again a User ID, and customer has a direct relation to User. Kentico stores wishlists for Users only, not contacts or customers. But ContactInfo and CustomerInfo have Wishlist property: if you look at the decompiled code of it, it retrieves a User from Customer or Contact and retrives a wishlist for that User.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Dmitry Bastron answered on March 6, 2020 12:42

Hi Harshal,

Unfortunately, it seems to be by design. If you look at the COM_Wishlist table it contains only UserID and cannot be assigned to contact (visitor). And it's not customizable. The problem is, all Public Anonymous users have the same account (= the same ID) so you can't store different wishlists for them.

You would need to develop wishlists functionality for anonymous visitors. And I'd recommend on register/login to move or merge items from your custom anonymous wishlist to Kentico out-of-the-box for User.

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on March 6, 2020 12:45 (last edited on March 6, 2020 12:47)

Well anonymous user has to become a customer first. It doesn't have to buy anything but he must be registered as a customer, so he can have a wish list

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.