Consuming Events

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
500lbdev
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Dec 14, 2007 12:06 pm

Consuming Events

Post by 500lbdev » Mon Jan 28, 2008 4:02 pm

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!

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Tue Jan 29, 2008 7:04 am

Wow could I use THAT feature!

(insert programmers drool)
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

500lbdev
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Fri Dec 14, 2007 12:06 pm

OrderStatusChanged Event

Post by 500lbdev » Wed Jan 30, 2008 9:43 am

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!

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Wed Jan 30, 2008 6:56 pm

Doesn't ANYONE program in VB around here? :wink:
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Post by jmestep » Thu Jan 31, 2008 9:00 am

{ no;
}
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Thu Jan 31, 2008 1:12 pm

HAR HAR HAR!

GOSUB WhereImAppreciated
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply