News:

Looking for documentation? Take a look on our wiki

Main Menu

How to write an Multi Manufacturer auto order plugin ?

Started by nrs, November 15, 2012, 13:44:14 PM

Previous topic - Next topic

nrs

Multi Manufacturer (or distributor or vendor or.. whatever you call it) auto order..

I am currently constructing a shop for a client (incl. the PHP code) , where the data for items currently it fetches from a data feed from the distributors.

I have made some PHP  batch scripts, that via SOAP or XML fetches the catalogues from the distributors, an place them in VM2's product tables (inc. price & a lot of custom fields.)

Now I want to send an order to the different distributors when the payment is accepted.

So, when a client orders 4 items (2 from dist1, 1 from dist2 and 1 from dist3), I have to ship 3 orders (one to each distributor), and wait for an accept from the different distributors that they can deliver..

All this works in a (quite dirty) hack in J1.5 VM1

For VM2, my plan was to write a plugin for each of the distributors interface (of curse they are different), and then hook them up on the plgVmConfirmedOrder() trigger..

But.. then I have to write the module as a part of the vmpayment group.. but as I currently understand the vm-groups, this is only for the interfacing to the payment gateways. (Or can I use this trigger in the other groups ?)

So.. what trigger to use, in witch group..  ? (or what did I misunderstand)

If anyone have a small program stub, that is triggered this way, it is welcome..

(Currently the distributors is emailing the client directly, when the goods are ready for delivery, but in the future I want to be able to collect this in a combined mail, also in the future I want to be able to deduct missing items from CC card.. But that will be another time)

SW used currently is J2.5.8 / VM2.0.14