Copied to clipboard

Flag this post as spam?

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


  • Simon 81 posts 184 karma points
    Nov 18, 2016 @ 13:22
    Simon
    0

    Merchello Abandoned Basket recovery

    Hi,

    Is there a way to load a Basket from the database?

    I'm working on an abandoned basket recovery process and in an email that gets sent out, I'd like to include a Complete your order link that goes through to the "Billing Address" page with a Url parameter containing the Basket GUID. This would then load their basket from the database and fill in any details (basket items, addresses etc.) that they'd provided before abandoning the checkout process.

    I know how to do all the rest - it's just loading the basket based on it's Guid from the database and overriding the current information I'm having issues with.

    Unfortunately, we can't rely on the cookie information due to multiple devices being used/owned by the customer.

    Thanks Simon

  • Simon 81 posts 184 karma points
    Nov 23, 2016 @ 09:55
    Simon
    0

    Hi Rusty,

    Any pointers on this? This is where I've got to so far - is this going down the right path?

    string basketId = Request.Params["bid"];
    string customerId = Request.Params["cid"];
    
    var helper = new MerchelloHelper();
    var basket = helper.Query.Order.GetByKey(new Guid(basketId));
    var customer = helper.Query.Customer.GetByKey(new Guid(customerId));
    
    this.Basket.Empty();
    
    foreach(ILineItem item in basket.Items)
         this.Basket.Items.Add(item);
    
    CustomerAddressDisplay address = customer.Addresses.Where(t => t.AddressType == AddressType.Billing).FirstOrDefault();
    
     FastTrackBillingAddressModel addressModel = new FastTrackBillingAddressModel{
            Address1 = address.Address1,
            Address2 = address.Address2,
            AddressType = AddressType.Billing,
            CountryCode = address.CountryCode,
            //Email
            //FirstName
            //LastName
            Locality = address.Locality,
            Name = address.FullName,
            Organization = address.Company,
            Phone = address.Phone,
            PostalCode = address.PostalCode,
            Region = address.Region
         };
    
      this.CheckoutManager.Customer.SaveBillToAddress(addressModel);
    

    Thanks

    Simon

  • Nicholas Wright 24 posts 144 karma points notactivated
    Jan 15, 2019 @ 14:48
    Nicholas Wright
    0

    Hi Simon,

    Did you manage to implement this ?

    Regards

Please Sign in or register to post replies

Write your reply to:

Draft