Table of Contents

Class ProductViewModelSettings

Namespace
Dynamicweb.Ecommerce.ProductCatalog
Assembly
Dynamicweb.Ecommerce.dll

Configuration of how a product viewmodel should be created.

public class ProductViewModelSettings : ViewSettingsBaseCurrencyBase<ProductViewModel>
Inheritance
ProductViewModelSettings
Inherited Members

Constructors

ProductViewModelSettings()

Initializes a new instance of ProductViewModelSettings with default settings. Used by the Web API infrastructure when deserializing settings from a request.

public ProductViewModelSettings()

ProductViewModelSettings(string, string, string, string)

Initializes product view model settings for the given language, currency, and shop context. Uses user ID 0 (anonymous).

public ProductViewModelSettings(string languageId, string currencyCode, string countryCode, string shopId)

Parameters

languageId string

The language ID used for localised values (e.g. "LANG1").

currencyCode string

ISO 4217 currency code (e.g. "EUR").

countryCode string

ISO 3166-1 alpha-2 country code for VAT (e.g. "DE").

shopId string

The shop ID used to scope products and groups.

ProductViewModelSettings(string, string, string, string, int)

Initializes product view model settings for the given language, currency, shop, and user context.

public ProductViewModelSettings(string languageId, string currencyCode, string countryCode, string shopId, int userId)

Parameters

languageId string

The language ID used for localised values (e.g. "LANG1").

currencyCode string

ISO 4217 currency code (e.g. "EUR").

countryCode string

ISO 3166-1 alpha-2 country code for VAT (e.g. "DE").

shopId string

The shop ID used to scope products and groups.

userId int

The user ID used for user-group discounts and access rules.

ProductViewModelSettings(string, string, string, string, int, bool, DateTime?, long)

Initializes product view model settings with full control over VAT display, order time, and stock location.

public ProductViewModelSettings(string languageId, string currencyCode, string countryCode, string shopId, int userId, bool showPricesWithVat, DateTime? time, long stockLocationId)

Parameters

languageId string

The language ID used for localised values.

currencyCode string

ISO 4217 currency code.

countryCode string

ISO 3166-1 alpha-2 country code.

shopId string

The shop ID used to scope products and groups.

userId int

The user ID used for user-group discounts.

showPricesWithVat bool

true to display prices including VAT.

time DateTime?

The order date/time for time-limited price rules; null uses the current time.

stockLocationId long

The stock location ID for location-specific pricing; 0 for the default location.

ProductViewModelSettings(string, string, string, string, int, bool, DateTime?, long, bool)

Initializes product view model settings with full control including reverse-charge VAT.

public ProductViewModelSettings(string languageId, string currencyCode, string countryCode, string shopId, int userId, bool showPricesWithVat, DateTime? time, long stockLocationId, bool reverseChargeForVat)

Parameters

languageId string

The language ID used for localised values.

currencyCode string

ISO 4217 currency code.

countryCode string

ISO 3166-1 alpha-2 country code.

shopId string

The shop ID used to scope products and groups.

userId int

The user ID used for user-group discounts.

showPricesWithVat bool

true to display prices including VAT.

time DateTime?

The order date/time for time-limited price rules; null uses the current time.

stockLocationId long

The stock location ID for location-specific pricing; 0 for the default location.

reverseChargeForVat bool

true when the buyer is responsible for VAT (B2B reverse charge).

Properties

AssetCategorySettings

Gets or sets the settings used to populate AssetCategories. Automatically initialised by EnsureFilledPropertiesExist() when null and AssetCategories is a filled property.

public AssetCategoryViewModelSettings AssetCategorySettings { get; set; }

Property Value

AssetCategoryViewModelSettings

CategoryFieldSettings

Gets or sets the settings used to populate ProductCategories. Automatically initialised by EnsureFilledPropertiesExist() when null and ProductCategories is a filled property.

public CategoryFieldViewModelSetting CategoryFieldSettings { get; set; }

Property Value

CategoryFieldViewModelSetting

GroupInfoSettings

Gets or sets the settings used to populate Groups, GroupPaths, and PrimaryOrDefaultGroup. Automatically initialised by EnsureFilledPropertiesExist() when null and any group property is a filled property.

public GroupInfoViewModelSettings GroupInfoSettings { get; set; }

Property Value

GroupInfoViewModelSettings

LoadVariantInfoOnVariants

Gets or sets a value indicating whether VariantInfo is loaded for products that are themselves variants (i.e. have a non-empty VariantId). Set to false when rendering variant-specific product pages to avoid the overhead of loading the full variant tree on already-resolved variants. Defaults to true.

public bool LoadVariantInfoOnVariants { get; set; }

Property Value

bool

ManufacturerSettings

Gets or sets the settings used to populate Manufacturer. Automatically initialised by EnsureFilledPropertiesExist() when null and Manufacturer is a filled property.

public ManufacturerViewModelSettings ManufacturerSettings { get; set; }

Property Value

ManufacturerViewModelSettings

MediaSettings

Gets or sets the settings used to populate media assets on the product (default image, image patterns). Automatically initialised by EnsureFilledPropertiesExist() when null and DefaultImage, ImagePatternImages, or AssetCategories is a filled property.

public MediaViewModelSettings MediaSettings { get; set; }

Property Value

MediaViewModelSettings

PriceSettings

Gets or sets the settings used to populate price properties on the product. Automatically initialised by EnsureFilledPropertiesExist() when null and any price property is in the filled-properties list.

public PriceViewModelSettings PriceSettings { get; set; }

Property Value

PriceViewModelSettings

ProductFieldSettings

Gets or sets the settings used to populate ProductFields. Automatically initialised by EnsureFilledPropertiesExist() when null and ProductFields is a filled property.

public FieldValueViewModelSetting ProductFieldSettings { get; set; }

Property Value

FieldValueViewModelSetting

StockUnitSettings

Gets or sets the settings used to populate StockUnits. Automatically initialised by EnsureFilledPropertiesExist() when null and StockUnits is a filled property.

public StockUnitViewModelSettings StockUnitSettings { get; set; }

Property Value

StockUnitViewModelSettings

UnitOptionSettings

Gets the settings used to populate UnitOptions. Automatically initialised by EnsureFilledPropertiesExist() when null and UnitOptions is a filled property.

public UnitOptionViewModelSettings UnitOptionSettings { get; }

Property Value

UnitOptionViewModelSettings

VariantInfoSettings

Gets or sets the settings used to populate VariantInfo. Automatically initialised by EnsureFilledPropertiesExist() when null and VariantInfo is a filled property.

public VariantInfoViewModelSettings VariantInfoSettings { get; set; }

Property Value

VariantInfoViewModelSettings

Methods

EnsureFilledPropertiesExist()

Called automatically by the view model builder pipeline. Initialises all nested settings objects based on which properties are in the filled-properties list, and falls back to system defaults for language, currency, and country when not supplied.

public override void EnsureFilledPropertiesExist()
To top