Looking for the v10 manual? Visit our new user's guide!
 
Search Descriptions Version
 
 
This article applies to: ML8, MultiStore

Event Handlers


Event Handlers are a system of callouts in the AspDotNetStorefront software that can post information to endpoint URLS when certain events happen on the site, making integration with 3rd-party applications easier. The software has several handlers built in, and store admins with the source code can add new events if desired.

NOTE: This is an advanced tool and will require a developer to set up. Stores without source code access will only be able to use the built-in handlers. Please note that Event Handlers will not function in medium trust hosting environments!

Also, please be aware that when creating a listener page to consume the posts made by EventHandlers, you must disable validation on the page if it is written in .NET. EventHandlers post XML-formatted data, which .NET's validation flags as invalid/unsafe.

Built in Event Handlers

The software comes with 18 built-in handlers, listed below. To enable an event handler, click the 'Edit' button, check the 'Active' checkbox, and specify a callback URL.

NOTE: The URL specified for the callback is a separate URL that a developer must create, this is not part of the AspDotNetStorefront software.

The included event handlers are:

ViewProductPage
ViewEntityPage
AddToCart
BeginCheckout
RemoveFromCart
CreateCustomer
UpdateCustomer
DeleteCustomer
NukeCustomer
CreateAccount
CheckoutShipping
CheckoutPayment
CheckoutReview
NewOrder
OrderDeleted
OrderVoided
OrderShipped
OrderRefunded

Adding Event Handlers

To add a custom event handler, first add it through the admin site with the 'Add New' box on this page.

Once that's done, add the following code wherever you want the handler to fire within the source code:

AppLogic.eventHandler(“CustomEventName”).CallEvent(“SomeRuntimeParams”);

The “CustomEventName” is the exact EventName specified in the admin site when the event was created

The “RunTimeParams” is an ampersand-delimited string (e.g. “someparam1=sometext&someparam2=othertext”). They are put in the “Runtime” section of the package data document.