Page 1 of 1
Consuming Events
Posted: Mon Jan 28, 2008 4:02 pm
by 500lbdev
Using the provided AbleCommerce API, is there a way to subscribe to certain events like Order Placed, Order Paid, etc. and add extra logic when these specific events are fired?
Thanks!
Posted: Tue Jan 29, 2008 7:04 am
by AbleMods
Wow could I use THAT feature!
(insert programmers drool)
OrderStatusChanged Event
Posted: Wed Jan 30, 2008 9:43 am
by 500lbdev
Yes! Wouldn't it be nice to have a global OrderStatusChanged event that could be consumed from any location within the project that passes the status as a property on the EventArgs. AbleCommerce -- (Hint...Hint). Here's a little code snippet that if added to the Order class could provide this functionality.
Code: Select all
public static EventHandler<OrderStatusEventArgs> OrderStatusChanged;
private void OnOrderStatusChanged(object sender, OrderStatusEventArgs e)
{
if (OrderStatusChanged != null)
{
OrderStatusChanged(sender, e);
}
}
I did notice that all of the payment forms have two events that can be consumed during the checkout process. CheckingOut and CheckedOut. CheckingOut can be used to perform logic before an actual checkout occurs and CheckOut after checkout occurs. To make things a little cleaner and more managable, I would have defined these events in a parent class (masterpaymentform.cs) and inherited this class from the other payment forms. I had to redefine the events in a new payment form that I wrote to provide loyalty points functionality. Nonetheless, I've really enjoyed working with AbleCommerce and have been able to add on just about anything without source code like anonymous checkout and loyalty points. It's a very customizable platform. Thanks!
Posted: Wed Jan 30, 2008 6:56 pm
by AbleMods
Doesn't ANYONE program in VB around here?

Posted: Thu Jan 31, 2008 9:00 am
by jmestep
{ no;
}
Posted: Thu Jan 31, 2008 1:12 pm
by AbleMods
HAR HAR HAR!
GOSUB WhereImAppreciated