Posted on 14/05/2019 16:13:59
Hi Dmitriy,
I have updated the ProcessResponse method in ProductManager.cs in the live integration project to get the 2 customfields from the response. I have added the following code to store values in 2 customfields:
foreach (ProductField pf in ProductField.GetProductFields())
{
if (pf.SystemName == "DiscountPercentage")
{
var productDiscountPercent = item.SelectSingleNode($"column [@columnName='ProductDiscountPercent']").InnerText;
if (productDiscountPercent != null)
{
productInfo[pf.SystemName] = productDiscountPercent;
}
}
if (pf.SystemName == "NetPrice")
{
var productNetPrice = item.SelectSingleNode($"column [@columnName='ProductNetPrice']").InnerText;
if (productNetPrice != null)
{
productInfo[pf.SystemName] = productNetPrice;
}
}
}
and i try to get and display the values in either the productfeed or productlistfeed with:
foreach (LoopItem item in GetLoop("CustomFieldValues"))
{
if (item.GetString("Product.CustomField.System") == "DiscountPercentage")
{
productObject.discountPercent = item.GetString("Product.CustomField.Value.Clean");
}
if (item.GetString("Product.CustomField.System") == "NetPrice")
{
productObject.netPrice = item.GetString("Product.CustomField.Value.Clean");
}
}
but the 2 customfields are empty. Do you have any idears?
best regards