VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Coding Central => Topic started by: overseas on January 22, 2016, 13:27:17 PM

Title: Hack Virtuemart updateStatusForOneOrder in Orders.php
Post by: overseas on January 22, 2016, 13:27:17 PM
Hello EveryBody,

I would like to add a new functionality in my virtuemart by adding the capapbility to send a file containing the orders directly to the supplier on status change.

I have done a part of the job by hacking the begining of the updateStatusForOneOrder function to create a file and upload it but I have some difficulties to find informations of the order.

I have seen that there is a variable : $data wich seem to contain all informations I need

$data = $this->getTable('orders');
$data->load($virtuemart_order_id);


I know how to have the status : $old_order_status = $data->order_status;

However, I need to have the following informations :
- vendor number
- product reference and quantities in the orders
-
...

could you give me the way to access to this informations in orders.php?

Thanks by advance

Best regards
Title: Re: Hack Virtuemart updateStatusForOneOrder in Orders.php
Post by: GJC Web Design on January 22, 2016, 15:00:01 PM
you should really try to avoid hacking and do this as a vmcustom plugin using the function  plgVmOnUpdateOrderShipment

then the order info should be available in the plugin as

$order = $this->getOrderinfo($data->virtuemart_order_id);