WooCommerce:管理员手动创建订单时需要挂钩 [英] WooCommerce: need hook when admin manually creates order

查看:167
本文介绍了WooCommerce:管理员手动创建订单时需要挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个网站使用WooCommerce.客户希望偶尔从订单管理员(WooCommerce>订单>添加订单)中手动创建订单.当他们单击该页面上的保存订单"时,我需要对订单进行一些其他处理.

One of my sites uses WooCommerce. The client wants to manually create orders occasionally from within order admin (WooCommerce > Orders > Add Order). I need to do some additional processing on the order when they click "Save Order" on that page.

是否有一个可用的钩子?我浏览了WooCommerce文档和挂钩列表,但一无所获.

Is there a hook available for that? I've looked through the WooCommerce documentation and list of hooks but found nothing.

推荐答案

看来woocommerce_process_shop_order_meta将对我有用,

It looks like woocommerce_process_shop_order_meta will work for me,

add_action( 'woocommerce_process_shop_order_meta', 'woocommerce_process_shop_order', 10, 2 );
function woocommerce_process_shop_order ( $post_id, $post ) {
        // my code here
}

这篇关于WooCommerce:管理员手动创建订单时需要挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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