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
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.
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
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.
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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()