Class Context
- Namespace
- Dynamicweb.Ecommerce.Common
- Assembly
- Dynamicweb.Ecommerce.dll
Get and set context variables of the eCommerce system like language, country and currency.
- Inheritance
-
Context
- Inherited Members
Properties
Cart
Gets the cart.
Property Value
- Order
Returns the cart from a session variables otherwise NULL is returned.
CartContext
Gets or sets the current cart context.
Property Value
- Order
Context The cart context.
Country
Gets or sets the country.
Property Value
- Country
The country. If no country found,
null
will be returned
CountrySetByCustomer
Gets or sets a value indicating whether the CurrencySetByCustomer session exists and has a value.
Property Value
- bool
true
if the CurrencySetByCustomer session exists and has a value; otherwise,false
.
Currency
Gets or sets the currency.
Property Value
- Currency
The currency from the session variables otherwise the default currency.
CurrencySetByCustomer
Gets or sets a value indicating whether the CurrencySetByCustomer session exists and has a value.
Property Value
- bool
true
if the CurrencySetByCustomer session exists and has a value; otherwise,false
.
DisplayPricesWithVat
Gets or sets a value indicating whether prices in frontend are displayed with or without VAT.
Property Value
- bool
true
if prices should be displayed with VAT; otherwise,false
.
DisplayPricesWithVatSetByCustomer
Gets or sets a value indicating whether Display
Property Value
- bool
true
if set explicitly; otherwise,false
.
FavoriteListID
Property Value
Language
Gets or sets the language.
Property Value
- Language
The language.
Exceptions
- Argument
Null Exception Setting a Language that is
null
.
LanguageID
Gets or sets the language ID.
Property Value
- string
The language ID.
Exceptions
- Invalid
Operation Exception Language ID does not exist in the context and default language does not exist.
- Invalid
Operation Exception Setting a language ID that does not exist.
LanguageSetByCustomer
Gets or sets a value indicating whether the LanguageSetByCustomer session exists and has a value.
Property Value
- bool
true
if the LanguageSetByCustomer session exists and has a value; otherwise,false
.
OrderTime
The value of this property is used when calculating prices, discounts, periods and all other places where products or order (or related information) are affected by time.
Property Value
- Date
Time The order time.
ReverseChargeForVatEnabled
Gets or sets a value indicating whether VAT is in a reverse charge situation. In this case, VAT is not present in the product price for the affected VAT groups. This is standard VAT law in EU for B2B, where the buyer must handle the VAT rather than the reseller.
Property Value
- bool
true
if VAT is in a reverse charge situation; otherwise,false
.
ShowUnTranslatedItems
Determines whether to show the untranslated items if the ShowUnTranslatedItems setting is checked.
Property Value
- bool
true
if the ShowUnTranslatedItems setting is checked; otherwise,false
.
StockLocation
Gets or sets the stock location.
Property Value
- Stock
Location The stock location. If no stock location found NULL will be returned
TimeOfLoad
Gets the time of load.
Property Value
- Date
Time The time of load. Value from the TimeOfLoad session.
Methods
LoadUserContextCarts()
Loads the user context carts.
RemoveCart(string)
Parameters
key
string
SetCart(Order)
Parameters
cart
Order
SetPersistentCartContext(string)
Sets the persistent cart context.
Parameters
contextId
stringThe cart context ID.