Here is a scenario:
The shop admin changes the status of an order
A plgVmOnUpdateOrderPayment method in a vmcustom plugin checks the new status anf if it's C, it should send the order data to an external API and if it returns with success, change the status to a new one (F) with a comment, which contains the data I got from the API.
As far as I can see there are 2 options.
- I manage to set the new status in the plugin with updateStatusForOneOrder, which stores the new status, customer_notified and comments, but VirtueMartModelOrders triggers this method before it stores the status which the shop admin set, so I get C (by shop admin) -> F (by vmcustom plugin) -> C (by VirtueMartModelOrders )
- I change $data->order_status to F but in this case I can't set the comment field
There is only one trigger AFTER the order is stored, which is vmcupon's plgVmCouponUpdateOrderStatus
Any idea how should I manage this?
Maybe a plgVmAfterUpdateOrder trigger could help with this.
any guess maybe?
Okay, but where is the bug you're reporting here?
hi, this is a 2018 topic, I haven't checked this lately.
hmmm. I just don't understand why this topic was displayed as the newest post on this forum :o
Someone deleted their last post...
Probably spam deletion.
Jörgen