Copied to clipboard

Flag this post as spam?

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


  • Jonas Nielsen 3 posts 73 karma points
    Aug 07, 2019 @ 05:04
    Jonas Nielsen
    0

    Shipping address is removed after saving shipment rate quote

    After I have saved the shipment rate quote the shipping address is removed from the customer. This is my code where the line

    Basket.GetCheckoutManager().Shipping.SaveShipmentRateQuote(quote);

    triggers the shipping address to be removed.

                var billingAddress = sh.GetAddressFromBillingAddress(addressDetails.BillingAddress);
                var shippingAddress = sh.GetAddressFromShippingAddress(addressDetails.ShippingAddress);
    
                Basket.GetCheckoutManager().Customer.SaveBillToAddress(billingAddress);
                Basket.GetCheckoutManager().Customer.SaveShipToAddress(shippingAddress);
    
    
    
                Basket.GetCheckoutManager().Shipping.ClearShipmentRateQuotes();
    
    
                var shipment = Basket.PackageBasket(addressDetails.ShippingAddress);
                if (shipment != null && shipment.Any())
                {
    
                    var quotes = shipment.Last().ShipmentRateQuotes();
    
                    var quote = quotes.FirstOrDefault(q => q.ShipMethod.Key.ToString().Equals(addressDetails.ShippingQuote));
    
                    Basket.GetCheckoutManager().Shipping.SaveShipmentRateQuote(quote);
    
    
                }
    
    
    
                Basket.Save();
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies