Woocommerce挂钩以更新订单 [英] Woocommerce hook for order update

查看:116
本文介绍了Woocommerce挂钩以更新订单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家早上好. 如标题所述,我正在尝试在更新订单时触发一个函数. 更具体地说,我要在更改并保存订单页面(管理员端)中的自定义字段时运行此功能.

我不是要查找订单何时完成或订单状态是否更新,而只是要查找此字段的更新时间.

当前我正在使用woocommerce_process_shop_order_meta钩子,但是它似乎不起作用.

有什么建议吗?
谢谢!

-编辑-

woocommerce_process_shop_order_meta是要使用的严格钩子,我在由该钩子触发的函数中出错,因此如果您需要在管理页面中单击更新顺序后运行某个函数,则这是正确的方法它.

解决方案

如编辑中所述,如果要在更新订单时触发功能或响应,则woocommerce_process_shop_order_meta是正确的选择.

Good morning everyone. As the title says I'm trying to fire a function when an order is updated. More specifically I want to run this function when a custom field in the order page (admin side) is changed and then saved.

I'm not looking to find out when an order is complete or when its status is updated, but just when this field is updated.

Currently I'm using woocommerce_process_shop_order_meta hook but it doesn't seem to work.

Any advice?
Thank you!

-- EDIT --

woocommerce_process_shop_order_meta is the righ hook to use, I was having an error in the function triggered by this hook so if you ever need to run a function after you click update order in the admin page this is the right way to do it.

解决方案

As written in the edit the woocommerce_process_shop_order_meta is the right hook to use if you want to trigger a function or a response when an order is update.

这篇关于Woocommerce挂钩以更新订单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆