post-purchase processing hook in the Ecommerce module
I was just reading Teresa Miller's blog post about the post-purchase processing hook in the ecommerce module but I didn't quite understand all of it. I understood that its possible to have code executed after two events are fired. What I'd like to do is integrate a client's QuickBooks Point-of-Sale software with the SF Ecommerce module. I have very little experience in writing this kind of custom code. Can anyone give me some direction on how to implement this?
If that's too much trouble, what other kinds of inventory management/control software would work better (more smoothly/easy implementation) with SF? Or, what kinds of CMS software would work easily with Quickbooks? I'm looking for options.
Hi Tyler,
Implementation of the post processing hook depends on your needs and how you want to utilize the post processing hook. I can give you a code sample that returns the customer and the orders associated with that customer. This is just one example of how you could use the post processing hook.
using
System;
using
Telerik.Sitefinity.Abstractions;
using
Telerik.Sitefinity.Modules.Ecommerce;
using
Telerik.Sitefinity.Modules.Ecommerce.Orders;
using
System.Linq;
namespace
SitefinityWebApp
public
class
Global : System.Web.HttpApplication
protected
void
Application_Start(
object
sender, EventArgs e)
Bootstrapper.Initialized +=
new
EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
void
Bootstrapper_Initialized(
object
sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
if
(e.CommandName ==
"Bootstrapped"
)
EcommerceEvents.OrderPlaced +=
new
EcommerceEvents.OnOrderPlaced(EcommerceEvents_OrderPlaced);
EcommerceEvents.PaymentResponse +=
new
EcommerceEvents.OnPostPaymentResponse(EcommerceEvents_PaymentResponse);
void
EcommerceEvents_PaymentResponse(Telerik.Sitefinity.Ecommerce.Payment.Model.IPaymentResponse paymentResponse)
//Write your own customizations
void
EcommerceEvents_OrderPlaced(Guid orderId)
OrdersManager ordersManager = OrdersManager.GetManager();
var order = ordersManager.GetOrder(orderId);
var customerId = order.Customer.Id;
var customer = ordersManager.GetCustomer(customerId);
var ordersOfACustomer = customer.Orders.ToList();