9

I'm trying to figure out where I could drop in some PHP code to notify a CRM we are using (Solve360) that a new order has been placed, and that an event should be created (API) to fulfill the order.

  1. Order Product
  2. Checkout
  3. Complete Checkout & Capture CC
  4. Side notify CRM
  5. Done

Not sure where to start, but I have had to make some small tweaks to fix the Quantum Gateway payment processor to work. In that module it appears that the objects for the order (email, amt, details) were available. However it seems it would be quite 'dirty' to insert more PHP code in there.

Ideas?

PHP 5.2.x & Magento 1.4.x

Israel Lopez
  • 1,135
  • 3
  • 11
  • 25

1 Answers1

18

What you should do is hook into the Magento event that is fired for a newly placed order and define your own class with the functionality you are looking for. See Customize Magento using Event/Observer for how to set up observers (you'll need to create your own module for this).

The event you want to listen for is sales_order_place_after, and when you declare an observer for it, your code will be called after any order is placed.

Hope that helps!

Thanks, Joe

Graham Miln
  • 2,724
  • 3
  • 33
  • 33
Joe Mastey
  • 26,809
  • 13
  • 80
  • 104
  • I'll second this. Event Observers are very easy to setup. Just a little code to your config.xml and you are ready to go. – Prattski Jun 01 '10 at 12:03
  • Awesome. After taking a look at the documentation, looks like I am going to use this route. Also, I didnt see an event for customer profile creation. Anyone know if there is a way to hook-in to action? – Israel Lopez Jun 01 '10 at 21:01