GroupFields
Summary
The GroupFields
loop lets you display the custom field groups added to a product.
Examples
Basic usage
Notice the use of @item.GetValue to get data from the loop variable.
If you just write @GetValue, the data will be taken from outside the loop.
Similarly, you have to use @item.GetLoop to use loops inside a loop.
<table>
<tr>
@foreach (LoopItem item in GetLoop("GroupFields") {
<td> @item.GetValue("Relevant.Tag") </td>
}
</tr>
</table>
Check if the loop exists
@if (Loops.Contains("GroupFields")) {
...
}
Example of usage
The following general example illustrates how to use a loop construct.
<table>
<!--@LoopStart(GroupFields)-->
<tr>
<td><!--@Loop:Tag--></td>
</tr>
<!--LoopEnd(GroupFields)-->
</table>
Check if the loop exists
<!--@If LoopDefined(GroupFields)-->
...
<!--@EndIf(GroupFields)-->
Available tags
Ecom:Product:GroupField.Type.ID
Returns type ID used for the group field.
RAZOR
@GetString("Ecom:Product:GroupField.Type.ID")
Ecom:Product:GroupField.Type.Name
Returns type Name used for the group field.
RAZOR
@GetString("Ecom:Product:GroupField.Type.Name")
Available loops
Groups
The Groups
loop lets you display the custom field group.
RAZOR
@foreach (LoopItem item in GetLoop("Groups")){ <p>@item.GetValue("TagName")</p> }