plugin that has a hook that is called whenever a order changes status

Started by welrachid, May 04, 2015, 10:55:14 AM

Previous topic - Next topic

welrachid

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
Best regards,
Wel

GJC Web Design

vm custom plugin and use function plgVmOnUpdateOrderPayment ($data,$old_order_status) probably
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

welrachid

Thanks.
but does the customplugins not only apply to PRODUCTS? or do they apply globally to entire system?
Best regards,
Wel

Studio 42

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.

welrachid

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
Best regards,
Wel