Dear Dynamicweb,
We have an issue with the method in ProductEditor, as "ParseValue" is hardcoded to use assortments even though is not activated in the solution.
I will suggest that the call to GetProductById is replaced with the version without use of the "useAssortments" parameter as activation of assortments will be handled right.
public static IEnumerable<object> ParseValue(IEnumerable<string> value)
{
var parsedValues = new List<object>();
string currentLanguageId = GetLanguageID();
if (value is object && value.Any())
{
foreach (string currentValue in value)
{
if (currentValue.StartsWith("g_"))
{
string groupId = currentValue.Replace("g_", string.Empty);
var parsedGroup = Services.ProductGroups.GetGroup(groupId);
if (parsedGroup is object)
{
parsedValues.Add(parsedGroup);
}
}
else if (currentValue.StartsWith("p_"))
{
var productValue = currentValue.Split(':');
string productId = productValue[0].Replace("p_", string.Empty).Replace(":", string.Empty);
string productVariantId = string.Empty;
if (productValue.Length > 1 && !string.IsNullOrWhiteSpace(productValue[1]))
{
productVariantId = productValue[1];
}
var parsedProduct = Services.Products.GetProductById(productId, productVariantId, currentLanguageId, true);
if (parsedProduct is object)
{
parsedValues.Add(parsedProduct);
}
}
}
}
return parsedValues;
}
Best regards,
Anders