コード例 #1
0
        private void CreateDynamicItemField(TemplateBuilder builder, ProductDefinitionField definitionField, int sortOrder, ID parentId)
        {
            ID id = definitionField.SitecoreTemplateFieldForVariant(parentId);

            TemplateFieldHelper.CreateField(builder, definitionField, sortOrder, id);
            _productDefinitionFieldIdToFieldIdMap[definitionField.ProductDefinitionFieldId] = id;
        }
コード例 #2
0
        public void AddDynamicFieldValuesForProduct(Product product, FieldList list, VersionUri version)
        {
            var properties = product.GetProperties().ToList();

            properties.Where(x => x.RenderForCulture(version.Language.CultureInfo.ToString()))
            .ToList()
            .ForEach(x => TemplateFieldHelper.AddDynamicFieldValuesForProduct(list, x, _productDefinitionFieldIdToFieldIdMap));
        }