Class ShippingService
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
public class ShippingService : ICacheStorage<string, Shipping>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
ShippingService
- Implements
- Inherited Members
Methods
ClearCache()
Clears cached shippings.
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
keys
IEnumerable<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
key
stringKey to reset
Clone(Shipping)
Clones this instance.
public Shipping Clone(Shipping shipping)
Parameters
shipping
Shipping
Returns
CopyShipping(string)
Copies the shipping, fees and country relations based on the shippingId, appending "(Copy)" to the name.
public void CopyShipping(string shippingId)
Parameters
shippingId
stringThe id of the shipping to copy.
Delete(string)
Deletes the shipping with specified id.
public void Delete(string shippingId)
Parameters
shippingId
stringThe id.
DeleteAll()
Deletes all shippings.
public void DeleteAll()
DeleteByLanguage(string)
Deletes translations by language.
public void DeleteByLanguage(string languageId)
Parameters
languageId
stringThe language id.
GetDefaultShippingMethod(string, bool)
Gets the default shipping method.
public Shipping GetDefaultShippingMethod(string countryCode, bool onlyActive)
Parameters
countryCode
stringThe country code.
onlyActive
boolIf 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 Shipping GetShipping(string shippingId)
Parameters
shippingId
string
Returns
GetShipping(string, string, string)
Gets the shipping methods that has relation to specified country.
public Shipping GetShipping(string shippingId, string countryCode, string regionCode)
Parameters
Returns
GetShippings()
Gets the shipping methods with country relations.
public IEnumerable<Shipping> GetShippings()
Returns
GetShippings(string, string, bool)
Gets the shipping methods with country relations.
public IEnumerable<Shipping> GetShippings(string countryCode, string regionCode, bool onlyActive)
Parameters
countryCode
stringThe country code.
regionCode
stringThe region code.
onlyActive
boolIf set to
true
, only active shipping methods will be included to the result, otherwise inactive will be also included.
Returns
GetShippingsForUser(User, IEnumerable<Shipping>)
Gets the active shipping methods the user has access to in the list of shippings provided.
public IEnumerable<Shipping> GetShippingsForUser(User user, IEnumerable<Shipping> shippings)
Parameters
user
UserThe User. Use null for anonymous user.
shippings
IEnumerable<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 IEnumerable<Shipping> GetShippingsForUser(User user, string countryCode, string regionCode)
Parameters
user
UserThe User. Use null for anonymous user.
countryCode
stringThe country code.
regionCode
stringThe region/state code.
Returns
- IEnumerable<Shipping>
A collection of shipping methods.
GetShippingsWithoutRegions(bool)
Gets the shipping methods with country relations.
public IEnumerable<Shipping> GetShippingsWithoutRegions(bool onlyActive)
Parameters
onlyActive
boolIf 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 void Save(Shipping shipping)
Parameters
shipping
ShippingThe shipping.