private Address GetBillingAddress(CartModel cart, Guid userGuid) { Address billingAddress = _billingAddressSameAsShippingAddress.Get(cart, userGuid) && cart.RequiresShipping ? _getShippingAddress.Get(userGuid) : _cartSessionManager.GetSessionValue <Address>(CartManager.CurrentBillingAddressKey, userGuid); if (billingAddress != null) { billingAddress.User = _getCurrentUser.Get(); } return(billingAddress); }
public CartModel Assign(CartModel cart, Guid userGuid) { List <CartItem> cartItems = GetItems(userGuid); DeleteNullProducts(cartItems); AssignAvailablity(cartItems); cart.CartGuid = GetCartGuid(userGuid); cart.User = CurrentRequestData.CurrentUser; cart.UserGuid = userGuid; cart.Items = cartItems; cart.OrderEmail = GetOrderEmail(userGuid); cart.GiftMessage = GetGiftMessage(userGuid); cart.BillingAddressSameAsShippingAddress = _billingAddressSameAsShippingAddress.Get(cart, userGuid); cart.TermsAndConditionsRequired = _ecommerceSettings.TermsAndConditionsRequired; cart.TermsAndConditionsAccepted = GetTermsAndConditionsAccepted(userGuid); return(cart); }