Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sam Gooch 24 posts 116 karma points
    Sep 19, 2017 @ 14:17
    Sam Gooch
    1

    WishList won't persist

    Hi

    As a logged in user, when I add an item to the wishlist and then call Save() it's not persisting. I can see the version key has changed against the wish list? Does anyone have any ideas?

        [HttpPost]
        public JsonResult Favourite(Guid key)
        {
            try
            {
                IWishList wishList = ((ICustomer)CurrentCustomer).WishList();
                var product = _productService.GetByKey(key);
                wishList.AddItem(product, 1);
                wishList.Save();
                return Json(true);
            }
            catch (Exception)
            {
                // log
                return Json(false);
            }
        }
    

    Using v.2.5.0 and Umbraco v7.6.5.

    Thanks in advance, Sam

  • Arjan Woldring 124 posts 231 karma points
    Oct 23, 2017 @ 15:21
    Arjan Woldring
    0

    Hi Sam,

    Did you find a solution to this problem? This week I'm gonna start with implementing a wishlist (preferable through Ajax).

    It's good to know what your findings are.

    Thanks, Arjan

  • Dossie Wossie 7 posts 100 karma points
    Oct 24, 2017 @ 18:56
    Dossie Wossie
    101

    Hi,

    If this is the case, a reason could be the item at hand doesnt have any stock. For a basket, this makes sense, but not for a wishlist.

    You can uncomment the following in merchello.config to check: task type="Merchello.Web.Validation.Tasks.ValidateProductInventoryTask, Merchello.Web"

    I wrote a custom version which simply checks if its a wishlisht instead of a regular basket, in that case, it doesnt check the stock.

  • Arjan Woldring 124 posts 231 karma points
    Oct 25, 2017 @ 09:15
    Arjan Woldring
    0

    That is useful info. I will keep that in mind while implementing.

    Thanks!

  • Arjan Woldring 124 posts 231 karma points
    Oct 26, 2017 @ 20:37
    Arjan Woldring
    0

    Thank you for pointing me in the right direction. I implemented also a custom task to handle the stock Issue. So all is good now!

Please Sign in or register to post replies

Write your reply to:

Draft