using Nop.Core.Domain.Catalog; using Nop.Core.Domain.Common; using Nop.Core.Domain.Customers; using Nop.Core.Domain.Directory; using Nop.Core.Domain.Orders; using Nop.Core.Domain.Shipping; namespace Nop.Services.Shipping; /// /// Represents a request for getting shipping rate options /// public partial class GetShippingOptionRequest { #region Ctor public GetShippingOptionRequest() { Items = new List(); } #endregion #region Properties /// /// Gets or sets a customer /// public virtual Customer Customer { get; set; } /// /// Gets or sets a shopping cart items /// public IList Items { get; set; } /// /// Gets or sets a shipping address (where we ship to) /// public Address ShippingAddress { get; set; } /// /// Shipped from warehouse /// public Warehouse WarehouseFrom { get; set; } /// /// Shipped from country /// public Country CountryFrom { get; set; } /// /// Shipped from state/province /// public StateProvince StateProvinceFrom { get; set; } /// /// Shipped from zip/postal code /// public string ZipPostalCodeFrom { get; set; } /// /// Shipped from county /// public string CountyFrom { get; set; } /// /// Shipped from city /// public string CityFrom { get; set; } /// /// Shipped from address /// public string AddressFrom { get; set; } /// /// Limit to store (identifier) /// public int StoreId { get; set; } #endregion #region Nested classes /// /// Package item /// public partial class PackageItem { /// /// Constructor /// /// Shopping cart item /// Product /// Override "Quantity" property of shopping cart item public PackageItem(ShoppingCartItem sci, Product product, int? qty = null) { ShoppingCartItem = sci; Product = product; OverriddenQuantity = qty; } /// /// Shopping cart item /// public ShoppingCartItem ShoppingCartItem { get; set; } /// /// Product /// public Product Product { get; set; } /// /// If specified, override "Quantity" property of "ShoppingCartItem /// public int? OverriddenQuantity { get; set; } /// /// Get quantity /// /// public int GetQuantity() { if (OverriddenQuantity.HasValue) return OverriddenQuantity.Value; return ShoppingCartItem.Quantity; } } #endregion }