Table of Contents

Class ProductListViewModelSettings

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

Controls which properties are populated on a ProductListViewModel, including nested settings for products, groups, facets, media, and pagination.

public class ProductListViewModelSettings : ViewSettingsBaseCurrencyBase<ProductListViewModel>
Inheritance
ProductListViewModelSettings
Inherited Members

Remarks

ProductListViewModelSettings is the root settings object for the product catalog pipeline. Assign nested settings objects (ProductSettings, GroupSettings, etc.) before calling EnsureFilledPropertiesExist() — any that are null will be auto-created with defaults derived from the language/currency/country context.

Constructors

ProductListViewModelSettings()

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

public ProductListViewModelSettings()

ProductListViewModelSettings(string, string, string, string, int)

Initializes product list settings for the given language, currency, and user context.

public ProductListViewModelSettings(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.

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

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

public ProductListViewModelSettings(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.

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

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

public ProductListViewModelSettings(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

CurrentPage

Gets or sets the 1-based page number of the paginated result set to return. For example, with PageSize=10 and CurrentPage=2, products 11–20 are returned.

public int CurrentPage { get; set; }

Property Value

int

FacetGroupSettings

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

public FacetGroupViewModelSettings FacetGroupSettings { get; set; }

Property Value

FacetGroupViewModelSettings

FieldToSpellCheck

Gets or sets the name of the index field used to generate spell-check suggestions.

public string FieldToSpellCheck { get; set; }

Property Value

string

GroupSettings

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

public ProductGroupViewModelSettings GroupSettings { get; set; }

Property Value

ProductGroupViewModelSettings

MediaSettings

Gets or sets the media settings applied to product images in the list. When set, this is forwarded to ProductSettings during EnsureFilledPropertiesExist().

public MediaViewModelSettings MediaSettings { get; set; }

Property Value

MediaViewModelSettings

PageSize

Gets or sets the maximum number of products to return per page. 0 returns all products without pagination.

public int PageSize { get; set; }

Property Value

int

ParameterToSpellCheck

Gets or sets the query-string parameter name that triggers spell-checking (e.g. "q").

public string ParameterToSpellCheck { get; set; }

Property Value

string

Parameters

Gets or sets additional key/value parameters forwarded to the search/index engine when building the product list query.

public Dictionary<string, string> Parameters { get; set; }

Property Value

Dictionary<string, string>

ProductSettings

Gets or sets the settings used to populate each ProductViewModel in the list. Automatically initialised by EnsureFilledPropertiesExist() when null and Products is a filled property.

public ProductViewModelSettings ProductSettings { get; set; }

Property Value

ProductViewModelSettings

Methods

EnsureFilledPropertiesExist()

Called automatically by the view model builder pipeline. Initialises all nested settings objects (ProductSettings, GroupSettings, FacetGroupSettings) 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()

See Also

To top