Developer forum

Forum » Development » Get product category field values returned as a list ?

Get product category field values returned as a list ?

Casper Rasmussen
Casper Rasmussen
Reply

Hi,

When using the "FieldDisplayGroups" loop, the "Ecom: Product.CategoryField.OptionLabel" and "Ecom: Product.CategoryField.Value" are both always returned as one string (how they are stored in the database).

This gives problems when the field type is a list (Ecom: Product.CategoryField.TypeID = 15), as the values are returned as one comma-seperated string.

A symptom of having it returned formatted as a comma-separated string is that no spaces are added after the comma, making values difficult to read. In addition, the word breake is incorrect when its content width is reached.

Ex.: "This,is,a text,with a werry,loooooooooooooong word".

I have tried to split the string at each comma, but values in list can concretely also contain commas (ex. As a number separator).

Is there a solution to getting values returned as a list?


Replies

 

You must be logged in to post in the forum