VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: Avexa on November 07, 2016, 19:09:36 PM

Title: How to get new order status code with plugin
Post by: Avexa on November 07, 2016, 19:09:36 PM
Hello,

I need to create plugin which will send order status to 3rd party application. We fire code on plgVmOnUpdateOrderPayment event, but problem is, that second parameter in plgVmOnUpdateOrderPayment event is not new status code, but old one (status code before change).

Do anybody know, how to get new status letter after changing order status?

Thank you in advance and sorry for bad english.
Title: Re: How to get new order status code with plugin
Post by: GJC Web Design on November 08, 2016, 14:11:55 PM
function plgVmOnUpdateOrderPayment ($data,$old_order_status) {

if($data->order_status=='C'){  //do something }
//add other  cases
}