Class ProductField
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Provides information about a product field.
[Serializable]
[PermissionEntity("ProductField")]
public class ProductField : IPermissionEntity, IPermissionEntityLookup
- Inheritance
-
Product
Field
- Implements
- Inherited Members
- Extension Methods
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 Product
ProductField(ProductField)
Initializes a new instance of the Product
Parameters
copyOf
ProductField The ProductField object.
ProductField(IDataReader)
Initializes a new instance of the Product
Parameters
dataReader
IDataReader DataReader.
ProductField(string)
Initializes a new instance of the Product
Parameters
fieldId
stringThe field ID.
Fields
PermissionName
Field Value
Properties
AllowChangesAcrossLanguages
Is used to indicate allowed changes across languages.
Property Value
AllowChangesAcrossVariants
Is used to indicate allowed changes across variants.
Property Value
CategoryId
Property Value
Description
The description of this field.
Property Value
DoNotRender
Is used to skip the field in the loops in the frontend rendering.
Property Value
FieldValueConversionDecimals
Gets or sets number of decimals to use
Property Value
FieldValueConversionDisplayRule
Gets or sets Indication for how to present the Value in channel/frontend
Property Value
FieldValueConversionPreset
Gets or sets Id from selected field value conversion, to use as Presentation unit
Property Value
- int?
ForeignCategoryId
Property Value
Id
Gets or sets the ID.
Property Value
- string
The ID.
IsList
Property Value
IsStandardEditable
Gets value indicating whether it is standard field with limited editing functionality(editable Validation
Property Value
ListPresentationType
Gets or sets the presentation type for this field (only applies for product fields of type "list").
Property Value
Remarks
Setting this property only makes sense for product fields of type "list".
Locked
Gets or sets a value indicating whether this Product
Property Value
- bool
true
if locked; otherwise,false
.
Name
Gets or sets the name.
Property Value
- string
The name.
ReadOnly
Is used to indicate if a field is read only
Property Value
Required
Is used to indicate if a field is required.
Property Value
Section
Gets or sets the field sect.
Property Value
- Product
Field Section Type The sort.
ShowFieldOnBothMasterAndVariant
Is used to indicate whether the field will be shown on all products
or hidden in master or variant according to Allow
Property Value
Sort
Gets or sets the sorting.
Property Value
- int
The sort.
SystemName
Gets or sets a system name.
Property Value
- string
System name.
TemplateName
Gets or sets the name of the template.
Property Value
- string
The name of the template.
TypeId
Gets or sets the type of ID.
Property Value
- int
The type of ID.
TypeName
Gets or sets the name of the type.
Property Value
- string
The name of the type.
Types
Gets or sets the types.
Property Value
- IEnumerable<Field
Type > The types.
ValidationPattern
Gets or sets the validation pattern.
Property Value
Methods
Delete()
Deletes this instance.
Delete(string)
Deletes the instance by ProductFieldID.
Parameters
fieldId
stringDB field name is ProductFieldID.
Fill(IDataReader)
Fills the properties from DataReader.
Parameters
dataReader
IDataReader DataReader.
FindProductFieldsBySystemName(string)
Finds the collection ProductField objects.
Parameters
systemName
stringSystem 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
Returns
- Dictionary<string, Product
Field > The field definitions
GetById(string)
Gets the ProductField object by ID.
Parameters
fieldId
stringDB field name is ProductFieldID.
Returns
GetCategoryFieldBySystemName(string)
Parameters
systemName
string
Returns
GetCategoryFields()
Returns
GetCategoryReferencedFieldId(string)
Parameters
fieldId
string
Returns
GetFieldLabel(string)
Gets the label for product field
Parameters
languageId
stringLanguage id
Returns
GetFieldLabel(string, bool)
Gets the label for product field
Parameters
languageId
stringLanguage id
addCategoryLabel
boolShows whether we should add the category name to category field label or not
Returns
GetFieldOptions()
Returns
GetProductFields()
Gets the collection custom ProductField objects.
Returns
GetProductFields(bool)
Gets the collection ProductField objects.
Parameters
excludeStandardFields
bool
Returns
GetStandardEditableField(string)
Gets the Product
Parameters
systemName
string
Returns
- Product
Field The standard Product
Field with the specified SystemName if found, otherwisenull .
GetStandardProductFields()
Returns
Lock()
Locks this instance.
Save(string)
Saves the properties into DB.
Parameters
fieldId
stringDB field name is ProductFieldID.
Exceptions
- Argument
Out OfRange Exception if imposible to create new field