+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Extending the checkout widget

Extending the checkout widget

2 posts, 0 answered
  1. Rick
    Rick avatar
    32 posts
    Registered:
    13 Dec 2006
    15 Apr 2013
    Link to this post
    I would like to be able to on order being placed intercept this function run some logic then have the order proceed as normal. I am trying the same logic I used to extend the registration form however I can not get that logic to work for the checkout process.

    Has anyone done this or have any insights into getting this done?
  2. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    17 Apr 2013
    Link to this post
    Hello Rick,

     I hope today finds you well.

    If you want complete control over the checkout process I'd urge you to take a look at our open source one-page-checkout example. The blog post can be found here. And source is on Git Hub.

    Additionally you can hook into the pre-process order event. Our documentation for this is here. It fires before the order is placed. In short it's like this:

    public class Global : System.Web.HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
            Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
        }
      
        private void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
        {
            if (e.CommandName == "Bootstrapped")
            {
                EcommerceEvents.PreProcessOrder += new EcommerceEvents.OnPreProcessOrder(EcommerceEvents_PreProcessOrder);
            }
        }
      
        private OrderValidator EcommerceEvents_PreProcessOrder(Guid cartOrderId, CheckoutState checkoutState, Customer customer)
        {
            OrderValidator validator = new OrderValidator();
            validator.IsOrderValid = true;
            validator.StatusMessage = "Order is valid";
      
            return validator;
        }
    }

    The documentation also includes information on all of our event methods.

    I hope this helps. Greetings,
    Patrick Dunn
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered