Ejemplo n.º 1
0
        public override bool GetDistributorShippingInfoForHMS(MyHLShoppingCart shoppingCart, MyHerbalife3.Ordering.ServiceProvider.SubmitOrderBTSvc.Shipment shippment)
        {
            //NOTE: TR Mappping with HMS, shipment state must be null, city must containt the State and CountryDistrict the City.
            if (shoppingCart != null && shoppingCart.DeliveryInfo != null && shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Shipping)
            {
                if (!shippment.Address.Line1.Contains(shippment.Address.CountyDistrict))
                {
                    shippment.Address.Line1 = string.Format("{0}, {1}", shippment.Address.CountyDistrict, shippment.Address.Line1);
                }

                if (!String.IsNullOrEmpty(shoppingCart.DeliveryInfo.Address.Address.StateProvinceTerritory))
                {
                    shippment.Address.CountyDistrict         = shippment.Address.City;
                    shippment.Address.City                   = shippment.Address.StateProvinceTerritory;
                    shippment.Address.StateProvinceTerritory = null;
                }
            }

            return(true);
        }
        /// <summary>
        /// Gets the shipment information to import into HMS.
        /// </summary>
        /// <param name="shoppingCart">The shopping cart.</param>
        /// <param name="shippment">The order shipment.</param>
        /// <returns></returns>
        public override bool GetDistributorShippingInfoForHMS(MyHLShoppingCart shoppingCart, MyHerbalife3.Ordering.ServiceProvider.SubmitOrderBTSvc.Shipment shippment)
        {
            if (shoppingCart != null && shoppingCart.DeliveryInfo != null)
            {
                string freightCodeInCart = shoppingCart.DeliveryInfo.FreightCode;
                var    session           = SessionInfo.GetSessionInfo(shoppingCart.DistributorID, shoppingCart.Locale);
                if (session.IsEventTicketMode || APFDueProvider.hasOnlyAPFSku(shoppingCart.CartItems, shoppingCart.Locale))
                {
                    return(true);
                }

                if (shoppingCart.FreightCode == "NOF")
                {
                    shippment.ShippingMethodID = shoppingCart.FreightCode = shoppingCart.DeliveryInfo.FreightCode = shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Shipping ? "UAF" : "PU";
                }
                if (shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Shipping)
                {
                    shoppingCart.DeliveryInfo.WarehouseCode = HLConfigManager.Configurations.ShoppingCartConfiguration.DefaultWarehouse;
                }
                if (!freightCodeInCart.Equals(shoppingCart.FreightCode))
                {
                    shoppingCart.Calculate();
                    ShoppingCartProvider.UpdateShoppingCart(shoppingCart);
                }
            }
            return(true);
        }
Ejemplo n.º 3
0
        public override bool GetDistributorShippingInfoForHMS(MyHLShoppingCart shoppingCart, MyHerbalife3.Ordering.ServiceProvider.SubmitOrderBTSvc.Shipment shippment)
        {
            var          deliveryOptionID = shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Shipping ? shoppingCart.DeliveryInfo.Address.ID : shoppingCart.DeliveryInfo.Id;
            ShippingInfo shippingInfo     = GetShippingInfoFromID(shoppingCart.DistributorID, shoppingCart.Locale, shoppingCart.DeliveryInfo.Option, deliveryOptionID, deliveryOptionID);

            if (shippingInfo != null && (shoppingCart.DeliveryInfo.FreightCode != shippingInfo.FreightCode || shoppingCart.DeliveryInfo.WarehouseCode != shippingInfo.WarehouseCode))
            {
                shoppingCart.DeliveryInfo = shippingInfo;
                shoppingCart.FreightCode  = shippingInfo.FreightCode;
                ShoppingCartProvider.UpdateShoppingCart(shoppingCart);
                shippment.WarehouseCode    = shippingInfo.WarehouseCode;
                shippment.ShippingMethodID = shippingInfo.FreightCode;
            }
            return(true);
        }
Ejemplo n.º 4
0
 public override bool GetDistributorShippingInfoForHMS(MyHLShoppingCart shoppingCart, MyHerbalife3.Ordering.ServiceProvider.SubmitOrderBTSvc.Shipment shippment)
 {
     retrieveFreightCode(shoppingCart, null);
     if (shoppingCart.DeliveryInfo != null)
     {
         shippment.ShippingMethodID = shoppingCart.DeliveryInfo.FreightCode;
     }
     return(true);
 }