Posted on 16/06/2014 17:05:43
Hi Imar,
You can make a notification subscriber that listens for the BeforeRenderingNewStep notification and tell the args object that you want to redirect to a different step.
Something like this
[Subscribe(Dynamicweb.Notifications.eCommerce.Cart.BeforeRenderingNewStep)]
public class NewStepObserver : NotificationSubscriber
{
public override void OnNotify(string notification, NotificationArgs args)
{
var stepArgs = args as Dynamicweb.Notifications.eCommerce.Cart.BeforeRenderingNewStepArgs;
stepArgs.RedirectToStepIndex = true;
stepArgs.StepIndex = 4; //Or whatever step you want to go to
}
}
Note, you still need to be able to pass the step validation. That is, for Order.Complete = false, you can only go to (and including) the checkout step. For Order.Complete = true, you can only move between steps after the checkout step.
- Jeppe