Class FieldOption
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Represents a single field option.
- Inheritance
-
Field
Option
- Inherited Members
Examples
using Dynamicweb.Ecommerce.Products;
namespace Dynamicweb.Ecommerce.Examples.Products
{
public class ProductFieldOptionHandlerSample
{
public string AddOption(string fieldId, string name, string value)
{
FieldOption option = new FieldOption
{
FieldId = fieldId,
Sort = Services.FieldOptions.MaximumSort(fieldId) + 1,
Value = value,
IsDefault = false
};
var languageId = Services.Languages.GetDefaultLanguageId();
option.SetName(languageId, name);
Services.FieldOptions.Save(option);
return option.Id;
}
}
}
Constructors
FieldOption()
Initializes a new instance of Field
FieldOption(FieldOption)
Initializes a new instance of Field
Parameters
option
FieldOption Option to copy property values from.
Properties
FieldId
Gets or sets and ID of the related field.
Property Value
Id
Gets or sets option ID.
Property Value
IsDefault
Gets or sets value indicating whether this option is selected by default.
Property Value
Sort
Gets or sets the sort number.
Property Value
Translations
Gets the translations for the current entity
Property Value
Value
Gets or sets the value associated with this option.
Property Value
Methods
GetName(string)
Parameters
languageId
string