Extending the checkout widget
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?
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;