Class ProductGroupViewModelSettings
- Namespace
- Dynamicweb.Ecommerce.ProductCatalog
- Assembly
- Dynamicweb.Ecommerce.dll
Controls which properties are populated on a ProductGroupViewModel, including media settings and custom field settings.
public class ProductGroupViewModelSettings : ViewSettingsBaseCurrencyBase<ProductGroupViewModel>
- Inheritance
-
ProductGroupViewModelSettings
- Inherited Members
Constructors
ProductGroupViewModelSettings()
Initializes a new instance of ProductGroupViewModelSettings with default settings. Used by the Web API infrastructure when deserializing settings from a request.
public ProductGroupViewModelSettings()
ProductGroupViewModelSettings(string, string, string, string?, int)
Initializes group view model settings for the given language, currency, and user context.
public ProductGroupViewModelSettings(string languageId, string currencyCode, string countryCode, string? shopId, int userId)
Parameters
languageIdstringThe language ID used for localised field values (e.g.
"LANG1").currencyCodestringISO 4217 currency code (e.g.
"EUR").countryCodestringISO 3166-1 alpha-2 country code (e.g.
"DE").shopIdstringThe shop ID used to scope the group hierarchy.
userIdintThe user ID used to apply user-group access rules.
Properties
FieldSettings
Gets or sets the configuration that controls which custom group fields are populated. Automatically initialised by EnsureFilledPropertiesExist() when null.
public FieldValueViewModelSetting? FieldSettings { get; set; }
Property Value
MediaSettings
Gets or sets how media assets are handled when populating group media. Automatically initialised by EnsureFilledPropertiesExist() when null.
public MediaViewModelSettings? MediaSettings { get; set; }
Property Value
ResolveListFieldOptions
Gets or sets a value indicating whether list group fields are resolved into their selected options. When true, the Value of a list group field is a List<T> of FieldOptionValueViewModel with the option name translated to LanguageId, and Type and ListType are set on the group fields. When false (the default), Value is the raw stored value, e.g. the comma-separated option values of a list field. The Delivery API group and product endpoints always set this to true; a value sent in the request is ignored.
public bool ResolveListFieldOptions { get; set; }
Property Value
Methods
EnsureFilledPropertiesExist()
Called automatically by the view model builder pipeline. Ensures that MediaSettings and FieldSettings are initialised and that all filled property lists are populated.
public override void EnsureFilledPropertiesExist()