Hi guys, is there a way to initiate some code when the event of a completed order has happened? Maybe in the same way Telligent do it with the CSModule implementation eg. csa.PostUserUpdate += new CSUserEventHandler(UpdateUser);
Thanks.
There certainly is, create a class and inherit it from IShopModule
Add a handler eg
em.AddShopEvent ( typeof ( OrderItemEvent ), new ShopEventHandler ( AutoCompleteOrderEvent ) );
and then do your work.
You can register for events for types of the following objects:
OrderEventOrderItemEventItemSubscriptionSubscriptionEvent
Cheers,Rob
Thanks Rob, thats perfect.
Now that I have you, is there anything I need to check to identify if this particular subscription is active? I can't find any status parameter on the item.
This is what I got so far:
void SubscriptionCompleted(object eventItem, ShopEventArgs e) { SubscriptionItem item = eventItem as SubscriptionItem; if(item != null) {
// Do something } }
SubscriptionItem is just the event, it contains the real subscription and on there there is a property called Active
How about this:
SubscriptionEvent subscription = eventItem as SubscriptionEvent; if(subscription != null && subscription.RequestEventType == SubscriptionEvent.EventType.Activated) {
// Do something
}
Give it a try, it should work.
It works! Cheers.
Yep, worked for me too. Thanks for the step-by-step guide Robert Nash!
hot tubs ventrillo server
Copyright 2007-2010, Four Roads LLC, All rights reserved.3617 Betty Drive STE IColorado Springs, CO 80917