[checkout] Purchase Queue

HenryT

Joined: 2010-08-10
Posts: 6
Posted: Tue, 2010-08-10 19:51

Hi Everyone,

I hope you can spare some time for a relative newbie.

I currentyl use the checkout module along with checkout by email, and paypal, and hopefully soon to be download.

The problem I am having is this, I am currently trying to set up a system in which any orders that are placed on the module are added to a Queue that is then pulled down into my desktop crm style setup.

I intend to use a web service from a company that i have found to add the items to the Queue, and the actual handling of the Q is not a problem. I even have a php function that will add to the queue, the problem is how to include this in the current checkout script, and therby feed the relevant data from the purchase - payment method, customer name, address, - item name etc - into the function to add it to the queue.

Any help (or nudge that i may be on the wrong track) would be really appreciated.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2010-08-11 19:23

You'll have to be more specific about what you mean by "orders that are placed are added to a queue" - the order details (like on an invoice) - or the digital files? Or something else?

 
HenryT

Joined: 2010-08-10
Posts: 6
Posted: Wed, 2010-08-11 20:50

Sorry, I'll try to be more specific.

What I'm looking for are the order details, just like on an invoice. At the moment I just use the emails that are generated to organise the orders and then manually enter them into a record in the crm. Instead of this I would like to use the function to add the order details to the queue at the point of order, be that by checkout(email) or checkout(paypal).

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2010-08-11 20:58

In what format do you want the information to put into the CRM?
What does the queue front-end of the CRM look like? A webpage?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2010-08-12 00:55
Quote:
I even have a php function that will add to the queue

Aha - I see. In that case the neat way is to create a small module that registers a listener for the GalleryCheckout::transactionChange event looking for a type of "clear" (i.e. payment cleared, go ahead and process the order) and run your code on that. The quick-and-dirty way is to hack GalleryCheckoutAPI.class from line 132 which is where that event is posted. It's important to check the status of the order is being set to 'clear' as that code is used multiple times for each order with different statuses.

 
HenryT

Joined: 2010-08-10
Posts: 6
Posted: Thu, 2010-08-12 19:05

Ok, thanks for the tips. I think It may be a little beyond my abilities, but I appreciate the help. Are there any guides or tuts for creating an event listener?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2010-08-12 19:12

I would hack the code into the GalleryCheckoutAPI.class first, and get the system working. Later on, if you want to make things neat you can spend a few days (I'll help) writing a module that will effectively do the exact same thing in the "right" way.

 
HenryT

Joined: 2010-08-10
Posts: 6
Posted: Thu, 2010-08-12 21:40

Thanks, thats very kind of you. I will get on it straight away.