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
languageIdstringThe language ID used for localised values (e.g.
"LANG1").currencyCodestringISO 4217 currency code (e.g.
"EUR").countryCodestringISO 3166-1 alpha-2 country code for VAT (e.g.
"DE").shopIdstringThe shop ID used to scope products and groups.
userIdintThe 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
languageIdstringThe language ID used for localised values.
currencyCodestringISO 4217 currency code.
countryCodestringISO 3166-1 alpha-2 country code.
shopIdstringThe shop ID used to scope products and groups.
userIdintThe user ID used for user-group discounts.
showPricesWithVatbooltrue to display prices including VAT.
timeDateTime?The order date/time for time-limited price rules; null uses the current time.
stockLocationIdlongThe stock location ID for location-specific pricing;
0for 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
languageIdstringThe language ID used for localised values.
currencyCodestringISO 4217 currency code.
countryCodestringISO 3166-1 alpha-2 country code.
shopIdstringThe shop ID used to scope products and groups.
userIdintThe user ID used for user-group discounts.
showPricesWithVatbooltrue to display prices including VAT.
timeDateTime?The order date/time for time-limited price rules; null uses the current time.
stockLocationIdlongThe stock location ID for location-specific pricing;
0for the default location.reverseChargeForVatbooltrue 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
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
FieldToSpellCheck
Gets or sets the name of the index field used to generate spell-check suggestions.
public string FieldToSpellCheck { get; set; }
Property Value
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
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
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
ParameterToSpellCheck
Gets or sets the query-string parameter name that triggers spell-checking (e.g. "q").
public string ParameterToSpellCheck { get; set; }
Property Value
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
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
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()