I would like to replace Block detailsCategoryFields on page eCom/Product/Blocks/Fields.cshtml and its renderer RenderProductCategoryFields.
But when I make a replacement Block in eCom/Product/Blocks/Custom_Blocks.cshtml I don't have the LoopItemVariables of the surrounding foreach available ...
How am I supposed to make this work?
foreach (LoopItem categoryGroup in GetLoop("ProductCategories")) { Block detailsCategoryFields = new Block() { Name = categoryFieldsLayout != "MainInformation" ? categoryGroup.GetString("Ecom:Product.Category.Name") : "", Id = ToPascalCase(categoryGroup.GetString("Ecom:Product.Category.Name")), SortId = 40, Template = RenderProductSection(categoryFieldsLayout, categoryFieldsView, categoryGroup.GetString("Ecom:Product.Category.Name"), RenderProductCategoryFields(categoryGroup.GetLoop("ProductCategoryFields"), categoryFieldsView)), Design = new Design { Size = "12", RenderType = RenderType.Column, HidePadding = true } }; productFieldsPage.Add(categoryFieldsLayout, detailsCategoryFields); }