Table of Contents

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

bool

AgentCode

Gets or sets the shipping agent code.
public string AgentCode { get; set; }

Property Value

string

AgentServiceCode

Gets or sets the shipping agent service code.
public string AgentServiceCode { get; set; }

Property Value

string

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

string

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

string

EligibleForFreeShipping

Gets or sets a value indicating whether shipping is eligible for free.
public bool EligibleForFreeShipping { get; set; }

Property Value

bool

FeeRulesSource

Gets or sets the source of fee rules.
public ShippingFeeRulesSources FeeRulesSource { get; set; }

Property Value

ShippingFeeRulesSources

FeeSelection

Gets or sets the rule for fee selection: high or low.
public string FeeSelection { get; set; }

Property Value

string

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

string

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

string

LimitsUseLogic

Gets or sets the limits use logic.
public ShippingLimitsUseLogics LimitsUseLogic { get; set; }

Property Value

ShippingLimitsUseLogics

Name

Gets or sets the name.
[Obsolete("Use GetName and SetName instead.")]
public string Name { get; set; }

Property Value

string

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

int

TakeDiscountIntoAccount

Gets or sets a value indicating whether discounts are taken into consideration for free shipping fee.
public bool TakeDiscountIntoAccount { get; set; }

Property Value

bool

Translations

Gets the translations
public TranslationCollection<ShippingTranslation> Translations { get; }

Property Value

TranslationCollection<ShippingTranslation>

UsePriceWithVat

Gets or sets the value indicating whether VAT is taken into consideration for free shipping fee.
public bool UsePriceWithVat { get; set; }

Property Value

bool

UserGroups

Gets or sets to whom user groups the shipping is shown.
public IEnumerable<int> UserGroups { get; set; }

Property Value

IEnumerable<int>

Methods

ClearCache()

Clear cached shippings
[Obsolete("Use Services.Shippings.ClearCache() instead.")]
public static void ClearCache()

Clone()

Clones this instance.
public Shipping Clone()

Returns

Shipping

Copy()

Copies this instance.
[Obsolete("This method is not used")]
public Shipping Copy()

Returns

Shipping

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

Shipping

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 page
class 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 page
class 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

shippingId string
The id.
theLanguageId string
The language id.

Examples

Delete line with shipping method on the page
class 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 page
class 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

string

GetAgentServiceDescription(string)

Gets the agent service description of the shipping for the given language.
public string GetAgentServiceDescription(string languageId)

Parameters

languageId string

Returns

string

GetAllShippingmethods()

Gets all shipping methods.
[Obsolete("Use Services.Shippings.GetShippingsWithoutRegions(String) instead.")]
public static ShippingCollection GetAllShippingmethods()

Returns

ShippingCollection

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

CountryRelation

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

Shipping

GetDescription(string)

Gets the description of the shipping for the given language.
public string GetDescription(string languageId)

Parameters

languageId string

Returns

string

GetName(string)

Gets the name of the shipping for the given language.
public string GetName(string languageId)

Parameters

languageId string

Returns

string

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

Shipping

GetShippingMethods()

Gets the shipping methods that has relation to any country.
[Obsolete("Use Services.Shippings.GetShipping(String) instead.")]
public static ShippingCollection GetShippingMethods()

Returns

ShippingCollection

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

ShippingCollection

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

ShippingCollection

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

ShippingCollection

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

ShippingCollection

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

ShippingCollection

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

ShippingCollection

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

countryCode string
The country code.
regionCode string
The region/state code.

Returns

ShippingCollection

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 string
value CountryRelation

SetAgentName(string, string)

Sets the agent name of the shipping for the given language.
public void SetAgentName(string languageId, string agentName)

Parameters

languageId string
agentName string

SetAgentServiceDescription(string, string)

Sets the agent service description of the shipping for the given language.
public void SetAgentServiceDescription(string languageId, string agentServiceDescription)

Parameters

languageId string
agentServiceDescription string

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

languageId string
description string

SetName(string, string)

Sets the name of the shipping for the given language.
public void SetName(string languageId, string name)

Parameters

languageId string
name string

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

newLanguageId string
The new language id.
oldLanguageId string
The old language id.

Examples

public static void changeLanguage(String languageID)
{
Shipping.UpdateLanguage( languageID, "" );
}
To top