public override ShippingInfo GetShippingInfoFromID(string distributorID, string locale, DeliveryOptionType type, int deliveryOptionID, int shippingAddressID) { ShippingInfo shippingInfo = base.GetShippingInfoFromID(distributorID, locale, type, deliveryOptionID, shippingAddressID); if (shippingInfo != null && shippingInfo.Address != null && type == DeliveryOptionType.Shipping) { List <DeliveryOption> shippingOptions = GetDeliveryOptionsListForShipping("BO", "es-BO", shippingInfo.Address); if (shippingOptions != null) { var shippingOption = shippingOptions.FirstOrDefault(); if (shippingOption != null && shippingInfo.FreightCode != shippingOption.FreightCode) { shippingInfo.FreightCode = shippingOption.FreightCode; shippingInfo.WarehouseCode = shippingOption.WarehouseCode; MyHLShoppingCart myShoppingCart = ShoppingCartProvider.GetShoppingCart(distributorID, locale); if (myShoppingCart != null) { if (myShoppingCart.ShippingAddressID != shippingInfo.Address.ID || myShoppingCart.FreightCode != shippingOption.FreightCode) { myShoppingCart.DeliveryInfo = shippingInfo; myShoppingCart.FreightCode = shippingOption.FreightCode; myShoppingCart.ShippingAddressID = shippingInfo.Address.ID; ShoppingCartProvider.UpdateShoppingCart(myShoppingCart); } } } } } return(shippingInfo); }
/// <summary> /// Gets the shipping instructions for the DS. /// </summary> /// <param name="shoppingCart">The shopping cart.</param> /// <param name="distributorID">Distributor ID.</param> /// <param name="locale">Locale.</param> /// <returns>The shipping instructions.</returns> public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { string shippingInstructions = string.Empty; if (!string.IsNullOrEmpty(shoppingCart.InvoiceOption)) { if (shoppingCart.InvoiceOption.Trim() == "SendToDistributor") { shippingInstructions = "Factura catre DS"; } } ShippingInfo currentShippingInfo = shoppingCart.DeliveryInfo; if (currentShippingInfo != null) { if (currentShippingInfo.Option == DeliveryOptionType.Pickup) { shippingInstructions = (shippingInstructions.Length > 0) ? string.Format("{0} {1}", shippingInstructions, currentShippingInfo.Instruction) : currentShippingInfo.Instruction; } } var skus = from i in shoppingCart.CartItems from s in skuForInstructions where i.SKU == s select i.SKU; if (skus.Count() > 0) { string instrBySKU = "Pretul pungilor include si Ecotaxa de 0.1 lei/buc"; shippingInstructions = (shippingInstructions.Length > 0) ? string.Format("{0} {1}", shippingInstructions, instrBySKU) : instrBySKU; } return(shippingInstructions); }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { ShippingInfo currentShippingInfo = shoppingCart.DeliveryInfo; // Checking for null, avoiding an exception. if (shoppingCart.InvoiceOption == null) { shoppingCart.InvoiceOption = string.Empty; } var invoiceOption = HttpContext.GetGlobalResourceObject("InvoiceOptions", shoppingCart.InvoiceOption.Trim(), CultureInfo.CurrentCulture); if (invoiceOption == null) { invoiceOption = shoppingCart.InvoiceOption.Trim(); } string instruction = string.Empty; if (shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Pickup) { return(instruction = string.Format("{0},{1},{2}", shoppingCart.DeliveryInfo.Address.Recipient, shoppingCart.DeliveryInfo.Address.Phone, invoiceOption)); } else { instruction = currentShippingInfo == null ? invoiceOption as string : string.Format("{0} {1}", currentShippingInfo.Instruction, invoiceOption); } return(instruction.Trim()); }
public override string GetRecipientName(ShippingInfo currentShippingInfo) { if (null == currentShippingInfo || currentShippingInfo.Address == null) { return(string.Empty); } string RecipientName = String.Empty; switch (currentShippingInfo.Address.Address.Line4) { case "Privatadresse": RecipientName = currentShippingInfo.Address.Recipient + " +PRIVAT"; break; case "Kundenadresse": RecipientName = currentShippingInfo.Address.Recipient + " KUNDE"; break; case "Adresse privee": RecipientName = currentShippingInfo.Address.Recipient + " +PRIVAT"; break; case "Adresse du client": RecipientName = currentShippingInfo.Address.Recipient + " KUNDE"; break; default: RecipientName = currentShippingInfo.Address.Recipient; break; } return(RecipientName); }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { ShippingInfo shippingInfo = shoppingCart.DeliveryInfo; string instruction = string.IsNullOrEmpty(shoppingCart.DeliveryInfo.Instruction) ? string.Empty : shoppingCart.DeliveryInfo.Instruction; if (shippingInfo != null) { if (shippingInfo.Option == DeliveryOptionType.PickupFromCourier) { string countryCode = locale.Substring(3, 2); List <PickupLocationPreference_V01> pickupLocationPreference = GetPickupLocationsPreferences(distributorID, countryCode); if (pickupLocationPreference != null && pickupLocationPreference.Count > 0) { var pickupLocation = pickupLocationPreference.Find(p => p.ID == shippingInfo.Id); // PickupFromCourier return instuction=RecipientNam,Phone if (shoppingCart.DeliveryInfo != null && pickupLocation != null && pickupLocation.PickupLocationID > 0) { return(instruction = string.Format("{0},{1} {2}", shoppingCart.DeliveryInfo.Address.Recipient, shoppingCart.DeliveryInfo.Address.Phone, pickupLocation.PickupLocationID.ToString())); } } return(string.Empty); } } return(base.GetShippingInstructionsForDS(shoppingCart, distributorID, locale)); }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { ShippingInfo currentShippingInfo = shoppingCart.DeliveryInfo; if (shoppingCart.DeliveryInfo != null && shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Pickup && HLConfigManager.Configurations.PickupOrDeliveryConfiguration.HasSpecialEventWareHouse && shoppingCart.DeliveryInfo.WarehouseCode == HLConfigManager.Configurations.PickupOrDeliveryConfiguration.SpecialEventWareHouse) { var distributorProfileModel = (MembershipUser <DistributorProfileModel>)Membership.GetUser(); var memberSubType = distributorProfileModel != null ? distributorProfileModel.Value.SubTypeCode : string.Empty; return(string.Format("Honors 2016, {0} MEMBER", memberSubType)); } if (currentShippingInfo.Option == DeliveryOptionType.Pickup) { return(string.Format("{0} A {1} {2} {3} {4} Gracias por su orden.", currentShippingInfo.Description.Trim(), currentShippingInfo.Address.Address.City, currentShippingInfo.Address.Address.PostalCode, currentShippingInfo.Address.Address.StateProvinceTerritory, currentShippingInfo.Address.Recipient)); } else { return(string.Format("{0} A {1} {2} {3} {4} Gracias por su orden.", currentShippingInfo.Name, currentShippingInfo.Address.Address.City, currentShippingInfo.Address.Address.PostalCode, currentShippingInfo.Address.Address.StateProvinceTerritory, currentShippingInfo.Address.Recipient)); } #endregion }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { ShippingInfo shippingInfo = shoppingCart.DeliveryInfo; if (shippingInfo != null) { if (shippingInfo.Option == DeliveryOptionType.PickupFromCourier) { string countryCode = locale.Substring(3, 2); List <PickupLocationPreference_V01> pickupLocationPreference = GetPickupLocationsPreferences(distributorID, countryCode); if (pickupLocationPreference != null && pickupLocationPreference.Count > 0) { var pickupLocation = pickupLocationPreference.Find(p => p.ID == shippingInfo.Id); var accessPoints = GetDeliveryOptionsFromCache(locale, null); if (pickupLocation != null && accessPoints != null) { var accessPoint = accessPoints.Where(ap => ap.Id == pickupLocation.PickupLocationID).FirstOrDefault(); if (accessPoint != null) { return(string.Format("{0} {1}", accessPoint.Id, accessPoint.Name)); } } } return(string.Empty); } } return(base.GetShippingInstructionsForDS(shoppingCart, distributorID, locale)); }
public override void GetDistributorShippingInfoForHMS(MyHLShoppingCart shoppingCart, MyHerbalife3.Ordering.ServiceProvider.OrderSvc.ShippingInfo_V01 address) { if (shoppingCart != null && shoppingCart.DeliveryInfo != null && shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Pickup) { ShippingInfo shippingInfo = base.GetShippingInfoFromID(shoppingCart.DistributorID, shoppingCart.Locale, shoppingCart.DeliveryInfo.Option, shoppingCart.DeliveryOptionID, shoppingCart.ShippingAddressID); SessionInfo sessionInfo = SessionInfo.GetSessionInfo(shoppingCart.DistributorID, shoppingCart.Locale); if (shippingInfo != null) { if (sessionInfo.IsEventTicketMode) { shoppingCart.DeliveryInfo.FreightCode = HLConfigManager.Configurations.CheckoutConfiguration.EventTicketFreightCode; shoppingCart.DeliveryInfo.WarehouseCode = shippingInfo.WarehouseCode; address.ShippingMethodID = HLConfigManager.Configurations.APFConfiguration.APFFreightCode; address.WarehouseCode = shippingInfo.WarehouseCode; } if (APFDueProvider.hasOnlyAPFSku(shoppingCart.CartItems, shoppingCart.Locale)) { shoppingCart.DeliveryInfo.FreightCode = HLConfigManager.Configurations.CheckoutConfiguration.EventTicketFreightCode; shoppingCart.DeliveryInfo.WarehouseCode = shippingInfo.WarehouseCode; address.ShippingMethodID = HLConfigManager.Configurations.APFConfiguration.APFFreightCode; address.WarehouseCode = shippingInfo.WarehouseCode; } } } }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { ShippingInfo currentShippingInfo = shoppingCart.DeliveryInfo; if (currentShippingInfo != null && currentShippingInfo.Option == DeliveryOptionType.Shipping) { int postCode = 0; if (currentShippingInfo.Address != null) { bool success = int.TryParse(currentShippingInfo.Address.Address.PostalCode, out postCode); if (success) { /// “Åland” if (postCode >= 22000 && postCode <= 22999) { DeliveryOption option = base.GetDeliveryOptions(locale).Find(o => o.FreightCode == "FIA"); if (null != option) { if (!string.IsNullOrEmpty(option.Description)) { return(option.Description); } } } } } } return(string.Empty); }
public override ShippingInfo GetShippingInfoFromID(string distributorID, string locale, DeliveryOptionType type, int deliveryOptionID, int shippingAddressID) { ShippingInfo shippingInfo = null; if (type == DeliveryOptionType.PickupFromCourier) { string countryCode = locale.Substring(3, 2); var pickupLocationPreference = GetPickupLocationsPreferences(distributorID, countryCode, null); if (pickupLocationPreference != null && pickupLocationPreference.Count > 0) { var vPickupLocation = pickupLocationPreference.Find( p => p.PickupLocationID == deliveryOptionID || p.ID == deliveryOptionID); if (vPickupLocation != null) { var deliveryOptions = GetDeliveryOptionForDistributor(distributorID, type); if (deliveryOptions != null) { var deliveryOption = deliveryOptions.Find(d => d.Id == vPickupLocation.PickupLocationID); if (deliveryOption == null) { deliveryOption = GetDeliveryOptionFromId(vPickupLocation.PickupLocationID, DeliveryOptionType.PickupFromCourier); } if (deliveryOption != null) { shippingInfo = new ShippingInfo(deliveryOption) { Id = deliveryOptionID }; // Get freight and warehouse if there are not shippingInfo.WarehouseCode = GetWareHouseCode("en-CA", shippingInfo.Address.Address .StateProvinceTerritory); if (string.IsNullOrEmpty(shippingInfo.FreightCode)) { var freights = GetDeliveryOptionsListForPickup("CA", "en-CA", null); var defFreight = freights.FirstOrDefault(o => o.IsDefault); if (defFreight != null) { shippingInfo.FreightCode = defFreight.FreightCode; } } shippingInfo.Address.AltPhone = shippingInfo.Address.Phone; shippingInfo.Address.Phone = string.Empty; } return(shippingInfo); } } } } else { shippingInfo = base.GetShippingInfoFromID(distributorID, locale, type, deliveryOptionID, shippingAddressID); } return(shippingInfo); }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { ShippingInfo currentShippingInfo = shoppingCart.DeliveryInfo; return(currentShippingInfo == null ? String.Empty : currentShippingInfo.Instruction); }
public override string GetFreightVariant(ShippingInfo shippingInfo) { if (shippingInfo != null && shippingInfo.Option == DeliveryOptionType.Pickup) { return(shippingInfo.WarehouseCode); } return(null); }
public override ShippingInfo GetShippingInfoFromID(string distributorID, string locale, DeliveryOptionType type, int deliveryOptionID, int shippingAddressID) { ShippingInfo shippingInfo = base.GetShippingInfoFromID(distributorID, locale, type, deliveryOptionID, shippingAddressID); if (shippingInfo != null && shippingInfo.Address != null && type == DeliveryOptionType.Shipping) { shippingInfo = GetShippingInfo(shippingInfo); } return(shippingInfo); }
public override string GetFreightVariant(ShippingInfo shippingInfo) { if (shippingInfo != null) { if (shippingInfo.Option == DeliveryOptionType.Pickup) { return(!string.IsNullOrEmpty(shippingInfo.WarehouseCode) ? shippingInfo.WarehouseCode : "47"); } } return(null); }
public override string GetShippingInstructions(ShippingInfo currentShippingInfo) { if (currentShippingInfo != null && currentShippingInfo.Option == DeliveryOptionType.Pickup) { return(currentShippingInfo.Instruction); } else { //return currentShippingInfo.Instruction; // :-) return(string.Empty); } }
public override string GetShippingInstructionsForDS( MyHLShoppingCart shoppingCart, string distributorId, string locale) { ShippingInfo shippingInfo = shoppingCart.DeliveryInfo; if (shippingInfo.Option == DeliveryOptionType.PickupFromCourier) { if (shippingInfo != null) { if (shippingInfo.Option == DeliveryOptionType.PickupFromCourier) { string countryCode = locale.Substring(3, 2); List <PickupLocationPreference_V01> pickupLocationPreference = GetPickupLocationsPreferences(distributorId, countryCode); if (pickupLocationPreference != null && pickupLocationPreference.Count > 0) { var pickupLocation = pickupLocationPreference.Find(p => p.ID == shippingInfo.Id); var accessPoints = GetDeliveryOptionsFromCache(locale, null); if (pickupLocation != null && accessPoints != null) { var ppp = accessPoints.Where(ap => ap.Id == pickupLocation.PickupLocationID).FirstOrDefault(); if (ppp != null) { return(string.Format("{0} {1}", ppp.Id, ppp.Name)); } } } } } return(string.Empty); } else { string instruction = string.IsNullOrEmpty(shoppingCart.DeliveryInfo.Instruction) ? string.Empty : shoppingCart.DeliveryInfo.Instruction; if (shoppingCart.DeliveryInfo.Address != null) { if (shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Pickup) { return (instruction = string.Format( "{0},{1},{2}", shoppingCart.DeliveryInfo.Address.Recipient, shoppingCart.DeliveryInfo.Address.Phone, instruction)); } } return(instruction); } }
private string getShippingInfoForFedexHal(MyHLShoppingCart shoppingCart) { ShippingInfo currentShippingInfo = shoppingCart.DeliveryInfo; if (currentShippingInfo != null) { if (currentShippingInfo.Option == DeliveryOptionType.PickupFromCourier && !string.IsNullOrEmpty(currentShippingInfo.Address.AltPhone)) { return(string.Format("FedEx Phone: {0}", currentShippingInfo.Address.AltPhone)); } } return(string.Empty); }
private static bool addressNotValid(ShippingInfo deliveryInfo) { if (deliveryInfo == null || deliveryInfo.Address == null || deliveryInfo.Address.Address == null || (string.IsNullOrEmpty(deliveryInfo.Address.Address.PostalCode) && string.IsNullOrEmpty(deliveryInfo.Address.Address.Line1) && string.IsNullOrEmpty(deliveryInfo.Address.Address.City)) ) { return(true); } return(false); }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { ShippingInfo shippingInfo = shoppingCart.DeliveryInfo; if (shippingInfo != null && shippingInfo.Option == DeliveryOptionType.Pickup && shippingInfo.Address != null) { return(string.Format("{0} {1} {2}", shippingInfo.Address.Recipient, shippingInfo.Address.Phone, shippingInfo.HKID)); } else if (shippingInfo != null) { return(shoppingCart.DeliveryInfo.Instruction); } return(string.Empty); }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorId, string locale) { ShippingInfo shippingInfo = shoppingCart.DeliveryInfo; if (shippingInfo != null && shippingInfo.Option == DeliveryOptionType.Pickup && shippingInfo.Address != null) { return(string.Format("{0} {1} Gracias por su Orden", shippingInfo.Address.Recipient, shippingInfo.Address.Phone)); } else if (shippingInfo != null && shippingInfo.Option == DeliveryOptionType.Shipping) { return(string.Format("{0},{1}", string.IsNullOrEmpty(shoppingCart.DeliveryInfo.Instruction) ? string.Empty : shoppingCart.DeliveryInfo.Instruction, "Gracias por su Orden")); } return(string.Empty); }
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); }
public override ShippingInfo GetShippingInfoFromID(string distributorID, string locale, DeliveryOptionType type, int deliveryOptionID, int shippingAddressID) { DeliveryOption deliveryOption = null; if (type == DeliveryOptionType.PickupFromCourier) { string countryCode = locale.Substring(3, 2); var pickupLocationPreference = GetPickupLocationsPreferences(distributorID, countryCode, null); if (pickupLocationPreference != null && pickupLocationPreference.Count > 0) { var vPickupLocation = pickupLocationPreference.Find(p => p.ID == deliveryOptionID); if (vPickupLocation != null) { int PickupLocationID = vPickupLocation.PickupLocationID; var doList = GetDeliveryOptions(type, new ShippingAddress_V01 { Address = new Address_V01 { Country = "CL" }, Alias = vPickupLocation.PickupLocationType }); if (doList != null) { deliveryOption = doList.Find(d => d.Id == PickupLocationID); if (deliveryOption != null) { //deliveryOption.Id = deliveryOption.ID = deliveryOptionID; var shippingInfo = new ShippingInfo(deliveryOption); shippingInfo.Id = deliveryOptionID; return(shippingInfo); } } } } } else { return(base.GetShippingInfoFromID(distributorID, locale, type, deliveryOptionID, shippingAddressID)); } return(null); }
public override int?GetDeliveryEstimate(ShippingInfo shippingInfo, string locale) { if (shippingInfo == null) { return(null); } if (shippingInfo.Option == DeliveryOptionType.Shipping) { var list = GetDeliveryOptionsListForShipping("MX", locale, shippingInfo.Address); var opt = list.Where(x => x.Name == shippingInfo.Name).Select(x => x.ShippingIntervalDays).FirstOrDefault(); return(opt); } return(null); }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { ShippingInfo currentShippingInfo = shoppingCart.DeliveryInfo; string instructions = ""; if (currentShippingInfo != null && currentShippingInfo.Option == DeliveryOptionType.Shipping) { instructions = _ShippingInstructions; } else if (currentShippingInfo != null && currentShippingInfo.Option == DeliveryOptionType.Pickup) { instructions = _PickupInstructions; } return(instructions); }
public override ShippingInfo GetShippingInfoFromID(string distributorID, string locale, DeliveryOptionType type, int deliveryOptionID, int shippingAddressID) { DeliveryOption deliveryOption = null; if (type == DeliveryOptionType.PickupFromCourier) { string countryCode = locale.Substring(3, 2); List <PickupLocationPreference_V01> pickupLocationPreference = GetPickupLocationsPreferences(distributorID, countryCode); if (pickupLocationPreference != null && pickupLocationPreference.Count > 0) { var vPickupLocation = pickupLocationPreference.Find(p => p.ID == deliveryOptionID); if (vPickupLocation != null) { int PickupLocationID = vPickupLocation.PickupLocationID; List <DeliveryOption> doList = GetDeliveryOptions(type, new ShippingAddress_V01 { Address = new Address_V01 { Country = "UA" } }); if (doList != null) { deliveryOption = doList.Find(d => d.Id == PickupLocationID); if (deliveryOption != null) { if (deliveryOption.Address != null && !string.IsNullOrEmpty(deliveryOption.Address.StateProvinceTerritory)) { List <DeliveryOption> doListDetails = GetDeliveryOptions(type, new ShippingAddress_V01 { Address = deliveryOption.Address }); deliveryOption = doListDetails.Find(d => d.Id == PickupLocationID); } //deliveryOption.Id = deliveryOption.ID = deliveryOptionID; ShippingInfo shippingInfo = new ShippingInfo(deliveryOption); shippingInfo.Id = deliveryOptionID; return(shippingInfo); } } } } } else { return(base.GetShippingInfoFromID(distributorID, locale, type, deliveryOptionID, shippingAddressID)); } return(null); }
/* * 1. Build the universal formula for Shipping Instructions: * a. Shipping Instructions Formula: * i. Servicio Ocurre (concatenate below fields/constants) * 1. Ocurre.NombreSucursal * 2. SPACE * 3. “A” * 4. SPACE * 5. Ocurre.CiudadPob * 6. SPACE * 7. Ocurre.Codígo Postal * 8. SPACE * 9. Ocurre.Estado * 10. SPACE * 11. ‘PICK UP NAME’ FIELD * 12. SPACE * 13. “Gracias por su orden” * ii Servicio Domicilio (concatenate below fields) * 1. Domicilio.Paqueteria * 2. SPACE * 3. “A” * 4. SPACE * 5. CodPostales.CiudadPob * 6. SPACE * 7. Domicilio.CodigoPostal * 8. SPACE * 9. CodPostales.Estado * 10. SPACE * 11. ‘PICK UP NAME’ FIELD * 12. SPACE * 13. “Gracias por su orden” * */ #endregion public override string GetShippingInstructions(ShippingInfo currentShippingInfo) { if (currentShippingInfo.Option == DeliveryOptionType.Pickup) { //PickupOption_V01 po = currentShippingInfo.ShippingOption as PickupOption_V01; //ShippingAddress_V01 sa = po.PickupAddress; return(string.Format("{0} {1} {2}/{3}/", currentShippingInfo.Name, currentShippingInfo.Address.Address.City, currentShippingInfo.Address.Address.PostalCode, currentShippingInfo.Address.Recipient)); } else { //return (currentShippingInfo.ShippingOption == null) ? "" : currentShippingInfo.ShippingOption.CourierName; return(currentShippingInfo.Name); } }
public override ShippingInfo GetShippingInfoFromID( string distributorID, string locale, DeliveryOptionType type, int deliveryOptionID, int shippingAddressID) { DeliveryOption deliveryOptionForAddress = null; ShippingInfo shippingInfo = null; if (type == DeliveryOptionType.PickupFromCourier) { string countryCode = locale.Substring(3, 2); var pickupLocationPreference = this.GetPickupLocationsPreferences(distributorID, countryCode); if (pickupLocationPreference != null && pickupLocationPreference.Count > 0) { var vPickupLocation = pickupLocationPreference.Find(p => p.ID == deliveryOptionID); if (vPickupLocation != null) { var pickupLocationID = vPickupLocation.PickupLocationID; var doList = this.GetDeliveryOptions(type, null); if (doList != null) { deliveryOptionForAddress = doList.Find(d => d.Id == pickupLocationID); if (deliveryOptionForAddress != null) { deliveryOptionForAddress.Address.Line4 = deliveryOptionForAddress.Description; //*******************TBD ************************************************************ //deliveryOptionForAddress.WarehouseCode = ""; //deliveryOptionForAddress.FreightCode = ""; //*******************TBD ************************************************************ shippingInfo = new ShippingInfo(deliveryOptionForAddress) { Id = deliveryOptionID }; return(shippingInfo); } } } return(shippingInfo); } } else { return(base.GetShippingInfoFromID(distributorID, locale, type, deliveryOptionID, shippingAddressID)); } return(null); }
public override string GetShippingInstructionsForDS(MyHLShoppingCart shoppingCart, string distributorID, string locale) { ShippingInfo currentShippingInfo = shoppingCart.DeliveryInfo; if (currentShippingInfo != null) { if (currentShippingInfo.Option == DeliveryOptionType.Pickup) { return(string.Format("{0}", currentShippingInfo.Address.Phone)); } else { return(currentShippingInfo.Instruction); } } return(string.Empty); }
public override ShippingInfo GetShippingInfoFromID(string distributorID, string locale, DeliveryOptionType type, int deliveryOptionID, int shippingAddressID) { ShippingInfo shippingInfo = base.GetShippingInfoFromID(distributorID, locale, type, deliveryOptionID, shippingAddressID); if (shippingInfo != null && shippingInfo.Address != null && type == DeliveryOptionType.Shipping) { var sessionInfo = SessionInfo.GetSessionInfo(distributorID, locale); var deliveryOptions = getDeliveryOptionsFromCache(locale); var shippingoptions = getDeliveryOptionFromID(deliveryOptionID, type, deliveryOptions, sessionInfo.IsEventTicketMode ? OrderCategoryType.ETO : OrderCategoryType.RSO); shippingInfo.FreightCode = shippingoptions.FreightCode; shippingInfo.WarehouseCode = shippingoptions.WarehouseCode; } return(shippingInfo); }
public override string GetFreightVariant(ShippingInfo shippingInfo) { if (shippingInfo != null && shippingInfo.Option == DeliveryOptionType.Shipping) { if (shippingInfo.FreightCode.Equals(HLConfigManager.Configurations.APFConfiguration.APFFreightCode)) { return(null); } Address_V01 address = shippingInfo != null && shippingInfo.Address != null ? shippingInfo.Address.Address : null; if (address != null) { return(address.Line3 == null ? "YO" : address.Line3); } } return(null); }