Hello,
We are experience some issues with the GetLoop("Details"). We are trying to create a JSON feed with product information and whitin this we want to get the documents under the section "Documents and files". The issues seems to be that we can not access the loop. The loop seems to work fine on a product page but not on a product list. Is it not possible to access this loop on a product list?
Or is there a other way to retrieve the information under the "Documents and files" section?
How the code is right now:
foreach (var product in products)
{
string prodName = product.GetString("Ecom:Product.Name");
string prodNumber = product.GetString("Ecom:Product.Number");
string prodElNumber = product.GetString("Ecom:Product:Field.ItemNo2");
string prodImage = product.GetString("Product.ImageCustom");
string prodShortDescription = product.GetString("Ecom:Product.ShortDescription");
string prodLongDescription = product.GetString("Ecom:Product.LongDescription");
List<string> productDetailsList = new List<string>();
var details = product.GetLoop("Details");
foreach (var item in details)
{
string prodUserManuals = item.GetString("Ecom:Product:Detail.Link");
productDetailsList.Add(prodUserManuals);
}
Product productObject = new Product();
productObject.Name = prodName;
productObject.Number = prodNumber;
productObject.ElNumber = prodElNumber;
productObject.Image = prodImage;
productObject.Details = productDetailsList;
productObject.ShortDescription = prodShortDescription;
productObject.LongDescription = prodLongDescription;
feedRoot.Products.Add(productObject);
}
feedObject.Add(feedRoot);
|
Best Regards
Alexander