VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: welrachid on May 04, 2015, 10:55:14 AM

Title: plugin that has a hook that is called whenever a order changes status
Post by: welrachid on May 04, 2015, 10:55:14 AM
Hi
i want to develop a plugin that calls an bookkeeping system (via API) whenever a order reaches a certain status (sent/delivered).
Where should i start when i want to extend VM?
I've developed both shipping module and a custom field module, but i cannot figure out if this plugin i want to make should be a JOOMLA plugin? or if i can make it a VM plugin?

update:
currently im looking at this:

administrator/components/com_virtuemart/controller/plugin.php

line 46: $typeWhiteList = array('vmshopper','vmcustom','vmcalculation','vmpayment','vmshipment', 'vmuserfield');

And it makes me think, how can i make a plugin that looks for changes in orderstatus?

administrator/components/com_virtuemart/plugins/vmExtendedPlugin.php

seems to be a valid plugin class to extend but it doesnt look like that it is on the whitelist?




thanks
/Wel
Title: Re: plugin that has a hook that is called whenever a order changes status
Post by: GJC Web Design on May 04, 2015, 11:22:46 AM
vm custom plugin and use function plgVmOnUpdateOrderPayment ($data,$old_order_status) probably
Title: Re: plugin that has a hook that is called whenever a order changes status
Post by: welrachid on May 04, 2015, 11:40:38 AM
Thanks.
but does the customplugins not only apply to PRODUCTS? or do they apply globally to entire system?
Title: Re: plugin that has a hook that is called whenever a order changes status
Post by: Studio 42 on May 04, 2015, 11:56:20 AM
Hi,
The vm plugin are called as a Joomla plugin but extend it that you can have multiple settings with the same plugin.
THis mean, you have to search for trigger in virtuemart to know the moment the plugins are called.
Sometime a system plugin can work or vmcustom plugin or paiement...
But if it's not possible with one plugin, then simply use 2 plugins and save the results in the same table if this is needed.
Title: Re: plugin that has a hook that is called whenever a order changes status
Post by: welrachid on May 04, 2015, 14:00:08 PM
Okay. thanks for your guidance. I will try working something out. I do find it wierd not to be able to make plgVmCustomXYZ that listens on all order status updates, without being a shipment or payment. But ok.. there's probably a good explaination on why this has to be this way. :)

Thanks