Class Shipping
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
Represents information about a shipping method
[Serializable]
public class Shipping
- Inheritance
-
Shipping
- Inherited Members
Constructors
Shipping()
Initializes a new instance of the Shipping class.
public Shipping()
Shipping(IDataReader)
Initializes a new instance of the Shipping class.
[Obsolete("Use Services.Shippings.GetShipping(String, String) instead.")]
public Shipping(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
Shipping(string)
Initializes a new instance of the Shipping class.
[Obsolete("Use Services.Shippings.GetShipping(String, String) instead.")]
public Shipping(string shippingId)
Parameters
shippingId
string- The shipping id.
Properties
Active
Gets or sets the value indicating whether instance is active.
public bool Active { get; set; }
Property Value
AgentCode
Gets or sets the shipping agent code.
public string AgentCode { get; set; }
Property Value
AgentServiceCode
Gets or sets the shipping agent service code.
public string AgentServiceCode { get; set; }
Property Value
AllowAnonymousUsers
Gets or sets a value indicating whether the Shipping is available to anonymous uses.
public bool AllowAnonymousUsers { get; set; }
Property Value
- bool
true
if shipping is available to anonymous users; otherwise,false
.
Code
Gets or sets the shipping code.
public string Code { get; set; }
Property Value
CountryId
Gets or sets the country id.
[Obsolete("Use CountryRelation instead.")]
public string CountryId { get; set; }
Property Value
- string
- The country id.
CountryRelation
Gets or sets the country relation.
[Obsolete("Use Services.CountryRelations.GetCountryRelation instead")]
public CountryRelation CountryRelation { get; set; }
Property Value
- CountryRelation
- The country relation.
CountryRelationCollection
Gets or sets the collection of country relation objects.
[Obsolete("Use Services.CountryRelations.GetCountryRelation instead")]
public CountryRelationCollection CountryRelationCollection { get; set; }
Property Value
- CountryRelationCollection
- The country relation collection.
Description
Gets or sets the description.
[Obsolete("Use GetDescription and SetDescription instead.")]
public string Description { get; set; }
Property Value
EligibleForFreeShipping
Gets or sets a value indicating whether shipping is eligible for free.
public bool EligibleForFreeShipping { get; set; }
Property Value
FeeRulesSource
Gets or sets the source of fee rules.
public ShippingFeeRulesSources FeeRulesSource { get; set; }
Property Value
FeeSelection
Gets or sets the rule for fee selection: high or low.
public string FeeSelection { get; set; }
Property Value
FreeFeeAmount
Gets or sets the free fee amount.
public double FreeFeeAmount { get; set; }
Property Value
- double
- The free fee amount.
Icon
Gets or sets the icon file name.
public string Icon { get; set; }
Property Value
Id
Gets or sets the id.
public string Id { get; set; }
Property Value
- string
- The id.
IsDefault
Gets or sets a value indicating whether this shipping is default.
[Obsolete("Use CountryRelation instead.")]
public bool IsDefault { get; set; }
Property Value
- bool
true
if this shipping is default; otherwise,false
.
LanguageId
Gets or sets the language id.
[Obsolete("Use Translations instead.")]
public string LanguageId { get; set; }
Property Value
LimitsUseLogic
Gets or sets the limits use logic.
public ShippingLimitsUseLogics LimitsUseLogic { get; set; }
Property Value
Name
Gets or sets the name.
[Obsolete("Use GetName and SetName instead.")]
public string Name { get; set; }
Property Value
PriceOverMaxWeight
Gets or sets the price for over max weight.
public double PriceOverMaxWeight { get; set; }
Property Value
- double
- The price over max weight.
ServiceParameters
Gets or sets the shipping service parameters.
public string ServiceParameters { get; set; }
Property Value
- string
- The shipping service parameters.
ServiceSystemName
Gets or sets the shipping service SystemName.
public string ServiceSystemName { get; set; }
Property Value
- string
- The shipping service SystemName.
Sorting
Sort order of current group inside parent group'theShipping children collection
public int Sorting { get; set; }
Property Value
TakeDiscountIntoAccount
Gets or sets a value indicating whether discounts are taken into consideration for free shipping fee.
public bool TakeDiscountIntoAccount { get; set; }
Property Value
Translations
Gets the translations
public TranslationCollection<ShippingTranslation> Translations { get; }
Property Value
UsePriceWithVat
Gets or sets the value indicating whether VAT is taken into consideration for free shipping fee.
public bool UsePriceWithVat { get; set; }
Property Value
UserGroups
Gets or sets to whom user groups the shipping is shown.
public IEnumerable<int> UserGroups { get; set; }
Property Value
Methods
ClearCache()
Clear cached shippings
[Obsolete("Use Services.Shippings.ClearCache() instead.")]
public static void ClearCache()
Clone()
Clones this instance.
public Shipping Clone()
Returns
Copy()
Copies this instance.
[Obsolete("This method is not used")]
public Shipping Copy()
Returns
Examples
class MyPage : System.Web.UI.Page
{
private Shipping shipping;
public Shipping DoSave()
{
Shipping theShipping = new Shipping();
theShipping = shipping.Copy();
return theShipping;
}
}
Create(string)
Returns the shipping with specified id.
[Obsolete("Use Services.Shippings.GetShipping(String, String) instead.")]
public static Shipping Create(string shippingId)
Parameters
shippingId
string- The shipping id.
Returns
Examples
private static String ReturnNameInsteadOfId(String id)
{
Shipping theShipping = Shipping.Create(id);
return theShipping.Name;
}
Delete()
Deletes this shipping.
[Obsolete("Use Services.Shippings.Delete(String, String) instead.")]
public void Delete()
Examples
Delete line with shipping method on the pageclass MyPage : System.Web.UI.Page
{
private void Page_Load(System.Object sender, System.EventArgs e)
{
String CMD = HttpContext.Current.Request.QueryString("CMD");
if(CMD == "DeleteShippingLine")
{
String shippingID = Converter.ToString(HttpContext.Current.Request.QueryString("ShippingID"));
Shipping theShipping = new Shipping(shippingID);
theShipping.Delete();
}
}
}
Delete(string)
Deletes the shipping with specified id.
[Obsolete("Use Services.Shippings.Delete(String, String) instead.")]
public void Delete(string shippingId)
Parameters
shippingId
string- The id.
Examples
Delete line with shipping method on the pageclass MyPage : System.Web.UI.Page
{
private void Page_Load(System.Object sender, System.EventArgs e)
{
String CMD = HttpContext.Current.Request.QueryString("CMD");
if(CMD == "DeleteShippingLine")
{
String shippingID = Converter.ToString(HttpContext.Current.Request.QueryString("ShippingID"));
Shipping theShipping = new Shipping();
theShipping.Delete(shippingID);
}
}
}
Delete(string, string)
Deletes the shipping with specified ID and language
[Obsolete("Use Services.Shippings.Delete(String, String) instead.")]
public void Delete(string shippingId, string theLanguageId)
Parameters
Examples
Delete line with shipping method on the pageclass MyPage : System.Web.UI.Page
{
private void Page_Load(System.Object sender, System.EventArgs e)
{
String CMD = HttpContext.Current.Request.QueryString("CMD");
if(CMD == "DeleteShippingLine")
{
String shippingID = Converter.ToString(HttpContext.Current.Request.QueryString("ShippingID"));
Shipping theShipping = new Shipping();
theShipping.Delete(shippingID, "DK");
}
}
}
DeleteAll()
Deletes all shippings.
[Obsolete("Use Services.Shippings.DeleteAll() instead.")]
public void DeleteAll()
DeleteByLanguage(string)
Deletes the by language.
[Obsolete("Use Services.Shippings.DeleteByLanguage(String) instead.")]
public void DeleteByLanguage(string theLanguageId)
Parameters
theLanguageId
string- The language id.
Examples
Delete line with shipping method on the pageclass MyPage : System.Web.UI.Page
{
private void Page_Load(System.Object sender, System.EventArgs e)
{
String CMD = HttpContext.Current.Request.QueryString("CMD");
if(CMD == "DeleteShippingLine")
{
String languageID = Converter.ToString(HttpContext.Current.Request.QueryString("LanguageID"));
Shipping theShipping = new Shipping();
theShipping.Delete(languageID);
}
}
}
get_CountryRelation(string)
Gets or sets the country relation object.
[Obsolete("Use GetCountryRelation instead")]
public CountryRelation get_CountryRelation(string shippingCountryId)
Parameters
shippingCountryId
string
Returns
- CountryRelation
- The country relation.
GetAgentName(string)
Gets the agent name of the shipping for the given language.
public string GetAgentName(string languageId)
Parameters
languageId
string
Returns
GetAgentServiceDescription(string)
Gets the agent service description of the shipping for the given language.
public string GetAgentServiceDescription(string languageId)
Parameters
languageId
string
Returns
GetAllShippingmethods()
Gets all shipping methods.
[Obsolete("Use Services.Shippings.GetShippingsWithoutRegions(String) instead.")]
public static ShippingCollection GetAllShippingmethods()
Returns
Examples
public String GetAllShippingData()
{
ShippingCollection dwShip = Shipping.getAllShippingmethods();
return GetShippingData( dwShip );
}
GetCountryRelation(string)
Gets the country relation object.
[Obsolete("Use Services.CountryRelations.GetCountryRelation instead")]
public CountryRelation GetCountryRelation(string shippingCountryId)
Parameters
shippingCountryId
string- Shipping country id
Returns
GetDefaultShippingMethod(string)
Gets the default shipping method.
[Obsolete("Use Services.Shippings.GetDefaultShippingMethod(String, String) instead.")]
public static Shipping GetDefaultShippingMethod(string countryCode)
Parameters
countryCode
string- The country code.
Returns
GetDescription(string)
Gets the description of the shipping for the given language.
public string GetDescription(string languageId)
Parameters
languageId
string
Returns
GetName(string)
Gets the name of the shipping for the given language.
public string GetName(string languageId)
Parameters
languageId
string
Returns
GetShippingmethodById(string)
Gets shipping method by its id.
[Obsolete("Use Services.Shippings.GetShipping(String, String) instead.")]
public static Shipping GetShippingmethodById(string id)
Parameters
id
string
Returns
GetShippingMethods()
Gets the shipping methods that has relation to any country.
[Obsolete("Use Services.Shippings.GetShipping(String) instead.")]
public static ShippingCollection GetShippingMethods()
Returns
Examples
public String GetShippingData()
{
ShippingCollection dwShip = Shipping.getShippingmethods();
return GetShippingData( dwShip );
}
GetShippingMethods(bool)
Gets the shipping methods that has relation to any country, if joinCountryRelations parameter is
true
.
Otherwise gets all shipping methods.[Obsolete("Use Services.Shippings.GetShippings(String) or Services.Shippings.GetShippingsWithoutRegions(String) instead.")]
public static ShippingCollection GetShippingMethods(bool joinCountryRelations)
Parameters
joinCountryRelations
bool- if set to
true
[join country relations].
Returns
Examples
public String GetAllShippingData()
{
ShippingCollection dwShip = Shipping.getShippingmethods(false);
return GetShippingData( dwShip );
}
GetShippingMethods(string)
Gets the shipping methods with the suitable country code.
[Obsolete("Use Services.Shippings.GetShippings(String, String, String) instead.")]
public static ShippingCollection GetShippingMethods(string countryCode)
Parameters
countryCode
string- The country code.
Returns
Examples
public String GetShippingMethodsForOrder(Order order)
{
ShippingCollection dwShip = Shipping.getShippingmethods( order.FeeCountryCode("SHIP") );
return GetShippingData( dwShip );
}
GetShippingMethods(string, string)
Gets the shipping methods with the suitable country code and shipping method id.
[Obsolete("Use Services.Shippings.GetShippings(String, String, String) instead.")]
public static ShippingCollection GetShippingMethods(string countryCode, string shippingIds)
Parameters
countryCode
string- The country code.
shippingIds
string- The shipping methods ID, separated by comma.
Returns
Examples
public String GetShippingMethodsForOrder(Order order)
{
ShippingCollection dwShip = Shipping.getShippingmethods( order.FeeCountryCode("SHIP"), order.ShippingMethodID );
return GetShippingData( dwShip );
}
GetShippingMethods(string, string, bool)
Gets the shipping methods with the suitable country code and shipping method ID, if joinCountryRelations parameter is
true
.
Otherwise gets all shipping methods.[Obsolete("Use Services.Shippings.GetShippings(String, String, String) instead.")]
public static ShippingCollection GetShippingMethods(string countryCode, string shippingIds, bool joinCountryRelations)
Parameters
countryCode
string- The country code.
shippingIds
string- The shipping methods ID, separated by comma.
joinCountryRelations
bool- if set to
true
[join country relations].
Returns
Examples
public String GetShippingMethodsForOrder(Order order)
{
ShippingCollection dwShip = Shipping.getShippingmethods( order.FeeCountryCode("SHIP"), order.ShippingMethodID, true );
return GetShippingData( dwShip );
}
GetShippingMethods(string, string, string)
Gets the shipping methods with the suitable country code, region code and shipping method id.
[Obsolete("Use Services.Shippings.GetShippings(String, String, String) instead.")]
public static ShippingCollection GetShippingMethods(string countryCode, string regionCode, string shippingIds)
Parameters
countryCode
string- The country code.
regionCode
string- The region/state code.
shippingIds
string- The shipping methods ID, separated by comma.
Returns
Examples
public String GetShippingMethodsForOrder(Order order)
{
ShippingCollection dwShip = Shipping.getShippingmethods( order.FeeCountryCode("SHIP"), order.ShippingMethodID );
return GetShippingData( dwShip );
}
GetShippingMethods(string, string, string, bool)
Gets the shipping methods with the suitable country code, region code and shipping method ID, if joinCountryRelations parameter is
true
.
Otherwise gets all shipping methods.[Obsolete("Use Services.Shippings.GetShippings(String, String, String) instead.")]
public static ShippingCollection GetShippingMethods(string countryCode, string regionCode, string shippingIds, bool joinCountryRelations)
Parameters
countryCode
string- The country code.
regionCode
string- The region/state code.
shippingIds
string- The shipping methods ID, separated by comma.
joinCountryRelations
bool- if set to
true
[join country relations].
Returns
Examples
public String GetShippingMethodsForOrder(Order order)
{
ShippingCollection dwShip = Shipping.getShippingmethods( order.FeeCountryCode("SHIP"), order.ShippingMethodID, true );
return GetShippingData( dwShip );
}
GetShippingmethodsByRegion(string, string)
Gets the shipping methods with the suitable country code and region code.
[Obsolete("Use Services.Shippings.GetShippings(String, String, String) instead.")]
public static ShippingCollection GetShippingmethodsByRegion(string countryCode, string regionCode)
Parameters
Returns
Examples
public String GetShippingMethodsForOrder(Order order)
{
ShippingCollection dwShip = Shipping.getShippingmethodsByRegion( order.FeeCountryCode("SHIP"), order.FeeRegionCode("SHIP", order.FeeCountryCode("SHIP")) );
return GetShippingData( dwShip );
}
Save(string)
Saves the specified id.
[Obsolete("Use Services.Shippings.Save(Shipping) instead.")]
public void Save(string shippingId)
Parameters
shippingId
string- The id.
Examples
public void SaveDefaultShippingData(string ShippingID)
{
Shipping ship = new Shipping();
ship.SetProperties();
ship.Save( ship.ID );
}
set_CountryRelation(string, CountryRelation)
[Obsolete("Use SetCountryRelation instead")]
public void set_CountryRelation(string shippingCountryId, CountryRelation value)
Parameters
shippingCountryId
stringvalue
CountryRelation
SetAgentName(string, string)
Sets the agent name of the shipping for the given language.
public void SetAgentName(string languageId, string agentName)
Parameters
SetAgentServiceDescription(string, string)
Sets the agent service description of the shipping for the given language.
public void SetAgentServiceDescription(string languageId, string agentServiceDescription)
Parameters
SetCountryRelation(CountryRelation)
Sets the country relation object.
[Obsolete("Do not use this.")]
public void SetCountryRelation(CountryRelation countryRelation)
Parameters
countryRelation
CountryRelation- The country relation
SetDescription(string, string)
Sets the description of the shipping for the given language.
public void SetDescription(string languageId, string description)
Parameters
SetName(string, string)
Sets the name of the shipping for the given language.
public void SetName(string languageId, string name)
Parameters
SetProperties()
Sets the default properties.
[Obsolete("This method is needed only for old API")]
public void SetProperties()
Examples
public void SaveDefaultShippingData(string ShippingID)
{
Shipping ship = new Shipping();
ship.SetProperties();
ship.Save( ship.ID );
}
UpdateLanguage(string, string)
Updates the language ID of shippings. If parameter OldLanguageID is specified the update will affect only suitable records
[Obsolete("This method is needed only for old API")]
public static void UpdateLanguage(string newLanguageId, string oldLanguageId)
Parameters
Examples
public static void changeLanguage(String languageID)
{
Shipping.UpdateLanguage( languageID, "" );
}