Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • K.Garrein 164 posts 629 karma points
    Apr 22, 2014 @ 11:41
    K.Garrein
    0

    Link to a specific basket from email

    Hey.

    My customer would like to prepare a shopping basket and send a link to a customer.

    When the customer visits the link, the products would then already be in his shopping basket, so all the customer would have to do is checkout and pay.

    Is that possible using uCommerce?

    Thanks.
    K.

  • Morten Skjoldager 440 posts 1499 karma points
    Apr 22, 2014 @ 12:54
    Morten Skjoldager
    0

    Yes it is. Not directly out of the box though. You can create orders from the backend of status basket and create a custom page with a link to the basket.

    You can then, on that page, set the current basket by setting the cookie. This is how we persist and clear cookies (baskets) through our API.

           public virtual void ClearBasketInformation()
            {
                var basket = GetBasket(false);
                if (basket != null)
                {
                    basket.PurchaseOrder.BasketId = Guid.Empty;
                    basket.PurchaseOrder.Save();
                }
    
                var basketCookie = new HttpCookie("basketid");
                basketCookie.Expires = DateTime.Now.AddDays(-1);
                HttpContext.Current.Request.Cookies.Remove("basketid");
                HttpContext.Current.Response.Cookies.Add(basketCookie);
            }
           private void PersistBasketId(Guid basketId)
            {
                if (!basketId.Equals(Guid.Empty))
                {
                    HttpCookie cookie = new HttpCookie("basketid", basketId.ToString());
                    cookie.Expires = DateTime.Now.AddDays(30);
                    HttpContext.Current.Response.Cookies.Add(cookie);
                    // Add cookie to http context in case the basket is requested additional times during this same request
                    // as the cookie will be available from the request only in the next request.
                    HttpContext.Current.Items.Add("basketid", cookie);
                }
            }
  • K.Garrein 164 posts 629 karma points
    Apr 24, 2014 @ 15:20
    K.Garrein
    0

    Thank you, I will try that.

    Kinds regards.
    Kris 

Please Sign in or register to post replies

Write your reply to:

Draft