News:

Support the VirtueMart project and become a member

Main Menu

Trigger updateSingleItem in own Plugin

Started by decola977, May 02, 2013, 11:09:37 AM

Previous topic - Next topic

decola977

Hello Folks,

i am writing an Virtue Mart Costum Plugin that has to be triggered as the Status of an order is update. So i wrote the method "plgVmOnUpdateSingleItem" in my plugin but nothing seems to happen. Any ideas?

RCheesley

I think you may find this function has been commented out (goodness only knows why) around lines 331-335 in administrator/components/com_virtuemart/models/orders.php - that might be a contributory factor!

whisky

Is there is any rational on why this plug-in call has been 'deprecated' ???

It would allow custom plug-in to update specific part of order items (e.g make up-to-date item by item status, for example on delivery, or any kind of acknowledgement).

Especially as :

1) the called Model Orders is updateSingleItem
2) the code read as

//       JPluginHelper::importPlugin('vmcustom');
//       $_dispatcher = JDispatcher::getInstance();
//       $_returnValues = $_dispatcher->trigger('plgVmOnUpdateSingleItem',array($table,&$orderdata));


and just after a merge of what could have been changed by such custom plug-ins
with line

      $orderdatacopy = $orderdata;
      $data = array_merge($dataT,(array)$orderdatacopy);

Where is there some dev documentation on this kind of decisions/discussion/rational ??

Thanks for any light.


K&K media production

Yes, this trigger is atm deactivated. I need it also and have it activated manually in order model. I talked with max and we will reactivate this trigger for Virtuemart 2.2. In this time until vm 2.2 will be stable, you can reactivate it manually.

Documentation for plugin development:

http://dev.virtuemart.net/projects/virtuemart/wiki/Developing_a_module_or_plugin_for_VirtueMart_2
http://dev.virtuemart.net/projects/virtuemart/wiki/Plugin_system

whisky

#4
Quote from: kkmediaproduction on November 26, 2013, 14:23:40 PM
Yes, this trigger is atm deactivated. I need it also and have it activated manually in order model. I talked with max and we will reactivate this trigger for Virtuemart 2.2. In this time until vm 2.2 will be stable, you can reactivate it manually.


I admit I have already uncommented the two lines, as I don't find a way to be able to write a custom/shipment combination plugins, in order to deliver software products (and licence)
and be able to allow sale administrator to edit order_status at the item level, without this call-back.

Tanks for the answer and good to see, that this is somewhat future proof ;-)