I have created a new condition for a promotion in our Sitecore Commerce site following this example. Is it possible to get cart details or the session id inside the evaluate method?
The evaluate method is triggered when user clicks on the 'apply promo' button in UI.
namespace Sitecore.Feature.Commerce.Promotions.Engine.Conditions
{
using Microsoft.ApplicationBlocks.Data;
using Sitecore.Commerce.Plugin.Carts;
using Sitecore.Framework.Rules;
using System;
using System.Data;
using System.IO;
using System.Web;
using System.Web.Configuration;
[EntityIdentifier("Future Event Dates")]
public class FutureEventDatesCondition : ICartsCondition, ICondition, IMappableRuleEntity
{
public IRuleValue<string> FutureEventStartDate { get; set; }
public IRuleValue<string> FutureEventEndDate { get; set; }
public bool Evaluate(IRuleExecutionContext context)
{
//how to get the cartid or sessionid in here
}
}
}
We are using Sitecore Commerce 8.2.1.