public override void SetShippingInfo(ServiceProvider.CatalogSvc.ShoppingCart_V01 cart) { var thisCart = cart as MyHLShoppingCart; if (thisCart != null) { if (thisCart.DeliveryInfo.Option == DeliveryOptionType.Shipping) { if (!this.SetFreightCodesForIBPOrders(thisCart) && !APFDueProvider.containsOnlyAPFSku(thisCart.CartItems)) { if (thisCart.Totals != null) { var state = (thisCart.DeliveryInfo.Address.Address.StateProvinceTerritory ?? string.Empty).Trim(); var city = (thisCart.DeliveryInfo.Address.Address.City ?? string.Empty).Trim(); if ((thisCart.Totals as OrderTotals_V01).ItemsTotal < CartAmountCap) { //set cart warehouseid if (IsMajorCity(state, city)) { thisCart.DeliveryInfo.FreightCode = "FSL"; } else { thisCart.DeliveryInfo.FreightCode = "IND"; } ShoppingCartProvider.UpdateShoppingCart(thisCart); // save to database } else { var provider = new ShippingProvider_IN(); var shippingInfo = provider.GetShippingInfoFromID( thisCart.DistributorID, thisCart.Locale, thisCart.DeliveryInfo.Option, thisCart.DeliveryOptionID, thisCart.DeliveryInfo.Address.ID); if (shippingInfo != null) { if (IsMajorCity(state, city)) { thisCart.DeliveryInfo.FreightCode = "FSL"; } else { thisCart.DeliveryInfo.FreightCode = "IND"; } thisCart.DeliveryInfo = shippingInfo; // will invoke save to database } } } } } } }
public override List <ServiceProvider.OrderSvc.InvoiceHandlingType> GetInvoiceOptions(ShippingAddress_V01 address, List <ServiceProvider.CatalogSvc.CatalogItem_V01> cartItems, ServiceProvider.CatalogSvc.ShoppingCart_V01 cart) { var listInvoiceOptions = base.GetInvoiceOptions(address, cartItems, cart); var shoppingCart = cart as MyHLShoppingCart; if (shoppingCart != null && shoppingCart.CustomerOrderDetail != null) { listInvoiceOptions.Clear(); listInvoiceOptions.Add(ServiceProvider.OrderSvc.InvoiceHandlingType.WithPackage); listInvoiceOptions.Add(ServiceProvider.OrderSvc.InvoiceHandlingType.SendToDistributor); } return(listInvoiceOptions); }