Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
We used the ValidateLineItemsActivity to change a certain validation:
var isPromoItem = lineItem["IsPromoItem"] != null;
//check if the entry is not available
if ((!isPromoItem && !entryRow.IsActive) || requestDate < minAvailableDate || requestDate > entryRow.EndDate)
{
AddWarningSafe(Warnings, "LineItemRemoved-" + lineItem.LineItemId.ToString(),
String.Format("Item \"{0}\" has been removed from the cart because it is not available.",
lineItem.DisplayName));
lineItemsToRemoved.Add(lineItem);
continue;
}
If I'm not mistaken, I should now use the IsValidCatalog in my custom DefaultLineValidator to add my validation:
protected override bool IsValidCatalog(EntryContentBase entry, DateTime requestDate)();
{
CatalogDto.CatalogRow catalogRow = this._catalogSystem.GetCatalogDto(entry.CatalogId).Catalog.FirstOrDefault
if (catalogRow != null && catalogRow.IsActive && requestDate >= catalogRow.StartDate)
return requestDate <= catalogrow.enddate>
return false;
}=>
My problem is that our custom property was on the lineitem and now I only have a EntryContentBase. Is there a way to access ou property from this function?
If not, how should I fix this?