Table of Contents

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

ProductField

ProductApprovalState

public static readonly ProductField ProductApprovalState

Field Value

ProductField

ProductCommentCount

public static readonly ProductField ProductCommentCount

Field Value

ProductField

ProductCost

public static readonly ProductField ProductCost

Field Value

ProductField

ProductCreated

public static readonly ProductField ProductCreated

Field Value

ProductField

ProductDefaultPoints

public static readonly ProductField ProductDefaultPoints

Field Value

ProductField

ProductDefaultShop

public static readonly ProductField ProductDefaultShop

Field Value

ProductField

ProductDefaultUnit

public static readonly ProductField ProductDefaultUnit

Field Value

ProductField

ProductDefaultVariantCombo

public static readonly ProductField ProductDefaultVariantCombo

Field Value

ProductField

ProductDepth

public static readonly ProductField ProductDepth

Field Value

ProductField

ProductDiscontinued

public static readonly ProductField ProductDiscontinued

Field Value

ProductField

ProductDiscontinuedAction

public static readonly ProductField ProductDiscontinuedAction

Field Value

ProductField

ProductEAN

public static readonly ProductField ProductEAN

Field Value

ProductField

ProductExpectedDelivery

public static readonly ProductField ProductExpectedDelivery

Field Value

ProductField

ProductHeight

public static readonly ProductField ProductHeight

Field Value

ProductField

ProductImageDefault

public static readonly ProductField ProductImageDefault

Field Value

ProductField

ProductImageLarge

public static readonly ProductField ProductImageLarge

Field Value

ProductField

ProductImageMedium

public static readonly ProductField ProductImageMedium

Field Value

ProductField

ProductImages

public static readonly ProductField ProductImages

Field Value

ProductField

ProductImageSmall

public static readonly ProductField ProductImageSmall

Field Value

ProductField

ProductLink1

public static readonly ProductField ProductLink1

Field Value

ProductField

ProductLink2

public static readonly ProductField ProductLink2

Field Value

ProductField

ProductLongDescription

public static readonly ProductField ProductLongDescription

Field Value

ProductField

ProductManufacturer

public static readonly ProductField ProductManufacturer

Field Value

ProductField

ProductMetaCanonical

public static readonly ProductField ProductMetaCanonical

Field Value

ProductField

ProductMetaDescription

public static readonly ProductField ProductMetaDescription

Field Value

ProductField

ProductMetaKeywords

public static readonly ProductField ProductMetaKeywords

Field Value

ProductField

ProductMetaTitle

public static readonly ProductField ProductMetaTitle

Field Value

ProductField

ProductMetaUrl

public static readonly ProductField ProductMetaUrl

Field Value

ProductField

ProductName

public static readonly ProductField ProductName

Field Value

ProductField

ProductNeverOutOfStock

public static readonly ProductField ProductNeverOutOfStock

Field Value

ProductField

ProductNumber

public static readonly ProductField ProductNumber

Field Value

ProductField

ProductOptimizedFor

public static readonly ProductField ProductOptimizedFor

Field Value

ProductField

ProductPeriod

public static readonly ProductField ProductPeriod

Field Value

ProductField

ProductPoints

public static readonly ProductField ProductPoints

Field Value

ProductField

ProductPrice

public static readonly ProductField ProductPrice

Field Value

ProductField

ProductPriceCounter

public static readonly ProductField ProductPriceCounter

Field Value

ProductField

ProductPriceMatrixMultiplePrices

public static readonly ProductField ProductPriceMatrixMultiplePrices

Field Value

ProductField

ProductPriceMatrixPeriod

public static readonly ProductField ProductPriceMatrixPeriod

Field Value

ProductField

ProductPriceMatrixQuantitySpecification

public static readonly ProductField ProductPriceMatrixQuantitySpecification

Field Value

ProductField

ProductPriceMatrixUnit

public static readonly ProductField ProductPriceMatrixUnit

Field Value

ProductField

ProductPriceMatrixVariant

public static readonly ProductField ProductPriceMatrixVariant

Field Value

ProductField

ProductPriceType

public static readonly ProductField ProductPriceType

Field Value

ProductField

ProductPurchaseMinimumQuantity

public static readonly ProductField ProductPurchaseMinimumQuantity

Field Value

ProductField

ProductPurchaseQuantityStep

public static readonly ProductField ProductPurchaseQuantityStep

Field Value

ProductField

ProductRating

public static readonly ProductField ProductRating

Field Value

ProductField

ProductRelatedCounter

public static readonly ProductField ProductRelatedCounter

Field Value

ProductField

ProductReplacementProduct

public static readonly ProductField ProductReplacementProduct

Field Value

ProductField

ProductReplacementVariant

public static readonly ProductField ProductReplacementVariant

Field Value

ProductField

ProductShortDescription

public static readonly ProductField ProductShortDescription

Field Value

ProductField

ProductStock

public static readonly ProductField ProductStock

Field Value

ProductField

ProductStockGroup

public static readonly ProductField ProductStockGroup

Field Value

ProductField

ProductType

public static readonly ProductField ProductType

Field Value

ProductField

ProductUnitCounter

public static readonly ProductField ProductUnitCounter

Field Value

ProductField

ProductUpdated

public static readonly ProductField ProductUpdated

Field Value

ProductField

ProductVariantCounter

public static readonly ProductField ProductVariantCounter

Field Value

ProductField

ProductVariantGroupCounter

public static readonly ProductField ProductVariantGroupCounter

Field Value

ProductField

ProductVariantProductCounter

public static readonly ProductField ProductVariantProductCounter

Field Value

ProductField

ProductVatGrp

public static readonly ProductField ProductVatGrp

Field Value

ProductField

ProductVolume

public static readonly ProductField ProductVolume

Field Value

ProductField

ProductWeight

public static readonly ProductField ProductWeight

Field Value

ProductField

ProductWidth

public static readonly ProductField ProductWidth

Field Value

ProductField

ProductWorkflowState

public static readonly ProductField ProductWorkflowState

Field Value

ProductField

ShowInProductList

public static readonly ProductField ShowInProductList

Field Value

ProductField

Properties

Description

The description of this field.
public string Description { get; set; }

Property Value

string

DoNotRender

Is used to skip the field in the loops in the frontend rendering.
public bool DoNotRender { get; set; }

Property Value

bool

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

bool

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

FieldListPresentationType

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

string

ValidationPattern

Gets or sets the validation pattern.
public string ValidationPattern { get; set; }

Property Value

string

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

IEnumerable<ProductField>

FindProductFieldsBySystemName(string, string)

Finds the collection of ProductField objects.
public static IEnumerable<ProductField> FindProductFieldsBySystemName(string systemName, string fieldId)

Parameters

systemName string
System name.
fieldId string
The field ID.

Returns

IEnumerable<ProductField>

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

ProductField

GetCategoryFields()

public static IEnumerable<ProductField> GetCategoryFields()

Returns

IEnumerable<ProductField>

GetFieldLabel(string)

Gets the label for product field
public string GetFieldLabel(string languageId)

Parameters

languageId string
Language id

Returns

string

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

string

GetFieldOptions()

public IEnumerable<FieldOption> GetFieldOptions()

Returns

IEnumerable<FieldOption>

GetProductFields()

Gets the collection custom ProductField objects.
public static IEnumerable<ProductField> GetProductFields()

Returns

IEnumerable<ProductField>

GetProductFields(bool)

Gets the collection ProductField objects.
public static IEnumerable<ProductField> GetProductFields(bool excludeStandartFields)

Parameters

excludeStandartFields bool

Returns

IEnumerable<ProductField>

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

IEnumerable<ProductField>

GetUpdateType()

public UpdateType GetUpdateType()

Returns

UpdateType

IsHidden()

Gets value indicates whether field is set as hidden in settings area
public bool IsHidden()

Returns

bool

IsLanguageEditingAllowed()

public bool IsLanguageEditingAllowed()

Returns

bool

IsReadOnly()

Gets value indicates whether field is set as read only in settings area
public bool IsReadOnly()

Returns

bool

IsRequired()

Gets value indicates whether field is set as required in settings area
public bool IsRequired()

Returns

bool

IsVariantEditingAllowed()

public bool IsVariantEditingAllowed()

Returns

bool

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.
To top