Class ShippingService
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
public class ShippingService : ICacheStorage<string, Shipping>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
ShippingService
- Implements
- Inherited Members
Fields
MethodType
public static readonly string MethodType
Field Value
Properties
Info
Information about the object cache
public CacheInformation Info { get; }
Property Value
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<string> keys)
Parameters
keysIEnumerable<string>Keys to reset
ClearCache(string)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(string key)
Parameters
keystringKey to reset
Clone(Shipping)
Clones this instance.
public virtual Shipping Clone(Shipping shipping)
Parameters
shippingShipping
Returns
CopyShipping(string)
Copies the shipping, fees and country relations based on the shippingId, appending "(Copy)" to the name.
public virtual void CopyShipping(string shippingId)
Parameters
shippingIdstringThe id of the shipping to copy.
Delete(string)
Deletes the shipping with specified id.
public virtual void Delete(string shippingId)
Parameters
shippingIdstringThe id.
DeleteAll()
Deletes all shippings.
public virtual void DeleteAll()
DeleteByLanguage(string)
Deletes translations by language.
public virtual void DeleteByLanguage(string languageId)
Parameters
languageIdstringThe language id.
GetDefaultShippingMethod(string, bool)
Gets the default shipping method.
public virtual Shipping GetDefaultShippingMethod(string countryCode, bool onlyActive)
Parameters
countryCodestringThe country code.
onlyActiveboolIf set to
true, only active shipping methods will be included to the result, otherwise inactive will be also included.
Returns
GetShipping(string)
Gets the shipping methods that has relation to any country.
public virtual Shipping GetShipping(string shippingId)
Parameters
shippingIdstring
Returns
GetShipping(string, string, string)
Gets the shipping methods that has relation to specified country.
public virtual Shipping GetShipping(string shippingId, string countryCode, string regionCode)
Parameters
Returns
GetShippings()
Gets the shipping methods with country relations.
public virtual IEnumerable<Shipping> GetShippings()
Returns
GetShippings(string, string, bool)
Gets the shipping methods with country relations.
public virtual IEnumerable<Shipping> GetShippings(string countryCode, string regionCode, bool onlyActive)
Parameters
countryCodestringThe country code.
regionCodestringThe region code.
onlyActiveboolIf set to
true, only active shipping methods will be included to the result, otherwise inactive will be also included.
Returns
GetShippingsByProductFilter(IEnumerable<Product>, IEnumerable<Shipping>)
Gets shippings which satisfy the product and product group filters.
public virtual IEnumerable<Shipping> GetShippingsByProductFilter(IEnumerable<Product> products, IEnumerable<Shipping> shippings)
Parameters
productsIEnumerable<Product>The products to check against.
shippingsIEnumerable<Shipping>The shippings to check.
Returns
- IEnumerable<Shipping>
A collection of shipping methods.
GetShippingsByWeight(double, IEnumerable<Shipping>)
Gets shippings which satisfy the weight limits.
public virtual IEnumerable<Shipping> GetShippingsByWeight(double totalWeight, IEnumerable<Shipping> shippings)
Parameters
totalWeightdoubleThe total weight to check the limits for.
shippingsIEnumerable<Shipping>The shippings to check.
Returns
- IEnumerable<Shipping>
A collection of shipping methods.
GetShippingsForUser(User, IEnumerable<Shipping>)
Gets the active shipping methods the user has access to in the list of shippings provided.
public virtual IEnumerable<Shipping> GetShippingsForUser(User user, IEnumerable<Shipping> shippings)
Parameters
userUserThe User. Use null for anonymous user.
shippingsIEnumerable<Shipping>The shippings to check if the user has access against.
Returns
- IEnumerable<Shipping>
A collection of shipping methods.
GetShippingsForUser(User, string, string)
Gets the active shipping methods with the suitable country code and region code for the user.
public virtual IEnumerable<Shipping> GetShippingsForUser(User user, string countryCode, string regionCode)
Parameters
userUserThe User. Use null for anonymous user.
countryCodestringThe country code.
regionCodestringThe region/state code.
Returns
- IEnumerable<Shipping>
A collection of shipping methods.
GetShippingsWithoutRegions(bool)
Gets the shipping methods with country relations.
public virtual IEnumerable<Shipping> GetShippingsWithoutRegions(bool onlyActive)
Parameters
onlyActiveboolIf set to
true, only active shipping methods will be included to the result, otherwise inactive will be also included.
Returns
Save(Shipping)
Saves the specified id.
public virtual void Save(Shipping shipping)
Parameters
shippingShippingThe shipping.
SetCacheType<TObjectCache>()
Changes the storage container
public void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, Shipping>
Type Parameters
TObjectCache