post-purchase processing hook in the Ecommerce module

Posted by Community Admin on 05-Aug-2018 22:56

post-purchase processing hook in the Ecommerce module

All Replies

Posted by Community Admin on 29-Feb-2012 00:00

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.

Posted by Community Admin on 05-Mar-2012 00:00

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();
        
  
    


Please let us know if you have anymore questions.

Greetings,
Grace Hallwachs
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed