Class ProductField
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Provides information about a product field.
[Serializable]
public class ProductField
- Inheritance
-
ProductField
- Inherited Members
Examples
using Dynamicweb.Ecommerce.Products;
namespace Dynamicweb.Ecommerce.Examples.Products
{
public class ProductGroupCustomFieldsRendererSample
{
public void RenderProductGroupCustomFields(ProductGroupFieldValueCollection productGroupFieldValues)
{
var values = new ProductFieldValueCollection();
foreach (var value in productGroupFieldValues)
{
var field = new ProductField();
var fieldValue = new ProductFieldValue(field, value.Value)
{
ProductField =
{
Types = value.ProductGroupField.Types,
TemplateName = value.ProductGroupField.TemplateName,
SystemName = value.ProductGroupField.SystemName
},
Value = value.Value
};
values.Add(fieldValue);
}
if (values.Count > 0)
{
//TODO: insert your code here
}
}
}
}
Constructors
ProductField()
Initializes a new instance of the ProductField class.
public ProductField()
ProductField(ProductField)
Initializes a new instance of the ProductField class.
public ProductField(ProductField copyOf)
Parameters
copyOf
ProductField- The ProductField object.
ProductField(IDataReader)
Initializes a new instance of the ProductField class.
public ProductField(IDataReader dataReader)
Parameters
dataReader
IDataReader- DataReader.
ProductField(string)
Initializes a new instance of the ProductField class.
public ProductField(string fieldId)
Parameters
fieldId
string- The field ID.
Fields
ProductActive
public static readonly ProductField ProductActive
Field Value
ProductApprovalState
public static readonly ProductField ProductApprovalState
Field Value
ProductCommentCount
public static readonly ProductField ProductCommentCount
Field Value
ProductCost
public static readonly ProductField ProductCost
Field Value
ProductCreated
public static readonly ProductField ProductCreated
Field Value
ProductDefaultPoints
public static readonly ProductField ProductDefaultPoints
Field Value
ProductDefaultShop
public static readonly ProductField ProductDefaultShop
Field Value
ProductDefaultUnit
public static readonly ProductField ProductDefaultUnit
Field Value
ProductDefaultVariantCombo
public static readonly ProductField ProductDefaultVariantCombo
Field Value
ProductDepth
public static readonly ProductField ProductDepth
Field Value
ProductDiscontinued
public static readonly ProductField ProductDiscontinued
Field Value
ProductDiscontinuedAction
public static readonly ProductField ProductDiscontinuedAction
Field Value
ProductEAN
public static readonly ProductField ProductEAN
Field Value
ProductExpectedDelivery
public static readonly ProductField ProductExpectedDelivery
Field Value
ProductHeight
public static readonly ProductField ProductHeight
Field Value
ProductImageDefault
public static readonly ProductField ProductImageDefault
Field Value
ProductImageLarge
public static readonly ProductField ProductImageLarge
Field Value
ProductImageMedium
public static readonly ProductField ProductImageMedium
Field Value
ProductImages
public static readonly ProductField ProductImages
Field Value
ProductImageSmall
public static readonly ProductField ProductImageSmall
Field Value
ProductLink1
public static readonly ProductField ProductLink1
Field Value
ProductLink2
public static readonly ProductField ProductLink2
Field Value
ProductLongDescription
public static readonly ProductField ProductLongDescription
Field Value
ProductManufacturer
public static readonly ProductField ProductManufacturer
Field Value
ProductMetaCanonical
public static readonly ProductField ProductMetaCanonical
Field Value
ProductMetaDescription
public static readonly ProductField ProductMetaDescription
Field Value
ProductMetaKeywords
public static readonly ProductField ProductMetaKeywords
Field Value
ProductMetaTitle
public static readonly ProductField ProductMetaTitle
Field Value
ProductMetaUrl
public static readonly ProductField ProductMetaUrl
Field Value
ProductName
public static readonly ProductField ProductName
Field Value
ProductNeverOutOfStock
public static readonly ProductField ProductNeverOutOfStock
Field Value
ProductNumber
public static readonly ProductField ProductNumber
Field Value
ProductOptimizedFor
public static readonly ProductField ProductOptimizedFor
Field Value
ProductPeriod
public static readonly ProductField ProductPeriod
Field Value
ProductPoints
public static readonly ProductField ProductPoints
Field Value
ProductPrice
public static readonly ProductField ProductPrice
Field Value
ProductPriceCounter
public static readonly ProductField ProductPriceCounter
Field Value
ProductPriceMatrixMultiplePrices
public static readonly ProductField ProductPriceMatrixMultiplePrices
Field Value
ProductPriceMatrixPeriod
public static readonly ProductField ProductPriceMatrixPeriod
Field Value
ProductPriceMatrixQuantitySpecification
public static readonly ProductField ProductPriceMatrixQuantitySpecification
Field Value
ProductPriceMatrixUnit
public static readonly ProductField ProductPriceMatrixUnit
Field Value
ProductPriceMatrixVariant
public static readonly ProductField ProductPriceMatrixVariant
Field Value
ProductPriceType
public static readonly ProductField ProductPriceType
Field Value
ProductPurchaseMinimumQuantity
public static readonly ProductField ProductPurchaseMinimumQuantity
Field Value
ProductPurchaseQuantityStep
public static readonly ProductField ProductPurchaseQuantityStep
Field Value
ProductRating
public static readonly ProductField ProductRating
Field Value
ProductRelatedCounter
public static readonly ProductField ProductRelatedCounter
Field Value
ProductReplacementProduct
public static readonly ProductField ProductReplacementProduct
Field Value
ProductReplacementVariant
public static readonly ProductField ProductReplacementVariant
Field Value
ProductShortDescription
public static readonly ProductField ProductShortDescription
Field Value
ProductStock
public static readonly ProductField ProductStock
Field Value
ProductStockGroup
public static readonly ProductField ProductStockGroup
Field Value
ProductType
public static readonly ProductField ProductType
Field Value
ProductUnitCounter
public static readonly ProductField ProductUnitCounter
Field Value
ProductUpdated
public static readonly ProductField ProductUpdated
Field Value
ProductVariantCounter
public static readonly ProductField ProductVariantCounter
Field Value
ProductVariantGroupCounter
public static readonly ProductField ProductVariantGroupCounter
Field Value
ProductVariantProductCounter
public static readonly ProductField ProductVariantProductCounter
Field Value
ProductVatGrp
public static readonly ProductField ProductVatGrp
Field Value
ProductVolume
public static readonly ProductField ProductVolume
Field Value
ProductWeight
public static readonly ProductField ProductWeight
Field Value
ProductWidth
public static readonly ProductField ProductWidth
Field Value
ProductWorkflowState
public static readonly ProductField ProductWorkflowState
Field Value
ShowInProductList
public static readonly ProductField ShowInProductList
Field Value
Properties
Description
The description of this field.
public string Description { get; set; }
Property Value
DoNotRender
Is used to skip the field in the loops in the frontend rendering.
public bool DoNotRender { get; set; }
Property Value
Id
Gets or sets the ID.
public string Id { get; set; }
Property Value
- string
- The ID.
IsStandardEditable
Gets value indicating whether it is standart field with limited editing functionality(editable ValidationErrorMessage, ValidationPattern, Description, DoNotRender and field settings).
public bool IsStandardEditable { get; }
Property Value
ListPresentationType
Gets or sets the presentation type for this field (only applies for product fields of type "list").
public FieldListPresentationType ListPresentationType { get; set; }
Property Value
Remarks
Setting this property only makes sense for product fields of type "list".
Locked
Gets or sets a value indicating whether this ProductField is locked.
public bool Locked { get; set; }
Property Value
- bool
true
if locked; otherwise,false
.
Name
Gets or sets the name.
public string Name { get; set; }
Property Value
- string
- The name.
Section
Gets or sets the field sect.
public ProductFieldSectionType Section { get; set; }
Property Value
- ProductFieldSectionType
- The sort.
Sort
Gets or sets the sorting.
public int Sort { get; set; }
Property Value
- int
- The sort.
SystemName
Gets or sets a system name.
public string SystemName { get; set; }
Property Value
- string
- System name.
TemplateName
Gets or sets the name of the template.
public string TemplateName { get; set; }
Property Value
- string
- The name of the template.
TypeId
Gets or sets the type of ID.
public int TypeId { get; set; }
Property Value
- int
- The type of ID.
TypeName
Gets or sets the name of the type.
public string TypeName { get; set; }
Property Value
- string
- The name of the type.
Types
Gets or sets the types.
public IEnumerable<FieldType> Types { get; set; }
Property Value
- IEnumerable<FieldType>
- The types.
ValidationErrorMessage
Gets or sets the validation error message.
[Obsolete("Use ProductFieldTranslation.GetTranslatedFieldErrorMessage(field, languageId)")]
public string ValidationErrorMessage { get; set; }
Property Value
ValidationPattern
Gets or sets the validation pattern.
public string ValidationPattern { get; set; }
Property Value
Methods
Delete()
Deletes this instance.
public void Delete()
Delete(string)
Deletes the instance by ProductFieldID.
public static void Delete(string fieldId)
Parameters
fieldId
string- DB field name is ProductFieldID.
Fill(IDataReader)
Fills the properties from DataReader.
public void Fill(IDataReader dataReader)
Parameters
dataReader
IDataReader- DataReader.
FindProductFieldsBySystemName(string)
Finds the collection ProductField objects.
public static IEnumerable<ProductField> FindProductFieldsBySystemName(string systemName)
Parameters
systemName
string- System name.
Returns
FindProductFieldsBySystemName(string, string)
Finds the collection of ProductField objects.
public static IEnumerable<ProductField> FindProductFieldsBySystemName(string systemName, string fieldId)
Parameters
Returns
GetAllEditableProductFields()
Gets editable fields for PIM
public static Dictionary<string, ProductField> GetAllEditableProductFields()
Returns
- Dictionary<string, ProductField>
- The field definitions
GetById(string)
Gets the ProductField object by ID.
public static ProductField GetById(string fieldId)
Parameters
fieldId
string- DB field name is ProductFieldID.
Returns
GetCategoryFields()
public static IEnumerable<ProductField> GetCategoryFields()
Returns
GetFieldLabel(string)
Gets the label for product field
public string GetFieldLabel(string languageId)
Parameters
languageId
string- Language id
Returns
GetFieldLabel(string, bool)
Gets the label for product field
public string GetFieldLabel(string languageId, bool addCategoryLabel)
Parameters
languageId
string- Language id
addCategoryLabel
bool- Shows whether we should add the category name to category field label or not
Returns
GetFieldOptions()
public IEnumerable<FieldOption> GetFieldOptions()
Returns
GetProductFields()
Gets the collection custom ProductField objects.
public static IEnumerable<ProductField> GetProductFields()
Returns
GetProductFields(bool)
Gets the collection ProductField objects.
public static IEnumerable<ProductField> GetProductFields(bool excludeStandartFields)
Parameters
excludeStandartFields
bool
Returns
GetStandardEditableField(string)
Gets the ProductField object by SystemName.
public static ProductField GetStandardEditableField(string systemName)
Parameters
systemName
string
Returns
- ProductField
- The standard ProductField with the specified SystemName if found, otherwise
null .
GetStandardProductFields()
public static IEnumerable<ProductField> GetStandardProductFields()
Returns
GetUpdateType()
public UpdateType GetUpdateType()
Returns
IsHidden()
Gets value indicates whether field is set as hidden in settings area
public bool IsHidden()
Returns
IsLanguageEditingAllowed()
public bool IsLanguageEditingAllowed()
Returns
IsReadOnly()
Gets value indicates whether field is set as read only in settings area
public bool IsReadOnly()
Returns
IsRequired()
Gets value indicates whether field is set as required in settings area
public bool IsRequired()
Returns
IsVariantEditingAllowed()
public bool IsVariantEditingAllowed()
Returns
Lock()
Locks this instance.
public void Lock()
Save(string)
Saves the properties into DB.
public void Save(string fieldId)
Parameters
fieldId
string- DB field name is ProductFieldID.
Exceptions
- ArgumentOutOfRangeException
- if imposible to create new field
SaveAtProduct(Product, NameValueCollection)
Saves the product.
[Obsolete]
public void SaveAtProduct(Product prod, NameValueCollection pfCollection)
Parameters
prod
Product- The product.
pfCollection
NameValueCollection- The NameValueCollection object.