Developer forum

Forum » Development » reaching Custom Group field in API

reaching Custom Group field in API

Dmitrij Jazel
Reply

Hi Guys,

Having trouble getting group custom field value from

Dynamicweb.eCommerce.Products.Group group

 object. in Razor API.

Checked my previous example, I used a template tag for that,

string extra_text = GetString("Ecom:Group:Field.ExtraText.Value.Clean");

But how do I retrieve the same within API and not from TemplateTags?

 

/Dmitrij

 


Replies

 
Viktor
Reply

Hi Dmitrij,

I guess you need:

 

            Dynamicweb.eCommerce.Products.Group group;            

            Dynamicweb.eCommerce.Products.ProductGroupFieldValueCollection groupCustomFields =  group.ProductGroupFieldValues;

            //ProductGroupFieldValueCollection inherits System.Collections.ObjectModel.Collection(Of ProductGroupFieldValue)

            foreach (var fieldValue in groupCustomFields )
            {
                var value = fieldValue.Value;
                var field = fieldValue.ProductGroupField
                var fieldName = field.Name;
            }

 

 

Best regards, Viktor Letavin

DynamicWEB Software A/S, Russian team

 

You must be logged in to post in the forum