News:

Looking for documentation? Take a look on our wiki

Main Menu

Update order status in plgVmOnUpdateOrderPayment

Started by sandomatyas, November 15, 2018, 16:47:17 PM

Previous topic - Next topic

sandomatyas

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.


hazael


sandomatyas

hi, this is a 2018 topic, I haven't checked this lately.

hazael

#4
hmmm. I just don't understand why this topic was displayed as the newest post on this forum  :o
Someone deleted their last post...

Jörgen

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.