WooCommerce 订单状态从支付网关更改 [英] WooCommerce order status change from payment gateway
问题描述
我已经集成了一个支付网关来接受我在 woocommerce 上运行的商店的在线支付.一切正常,但我注意到 woocommerce 默认将所有在线付费订单的订单状态更改为 wc-processing
.
I have integrated a payment gateway to accept online payments for my store running on woocommerce. Everything works fine but I noticed that woocommerce is changing the order status to wc-processing
for all the online paid orders by default.
根据我商店的功能,我希望所有在线付费订单最初都处于 wc-on-hold
状态.
As per my store's functionality I want all the online paid orders to be in wc-on-hold
status initially.
有什么方法可以阻止 woocommerce 以编程方式将订单状态更改为 wc-processing
?
Is there any way to stop woocommerce changing the order status to wc-processing
programatically?
推荐答案
是的有办法,但是需要修改支付插件或者添加自己的代码,可以阅读本文以了解付款方式.
yes there is a way, but you need to modify the payment plugin or add your own code, you can read this to understand how payments work.
现在woocommerce使用$order->payment_complete()
方法来处理已完成的订单,所以需要自己hook自己的函数来修改状态,这里是该方法的说明
Now, woocommerce use $order->payment_complete()
method to handle the completed order, so you need to hook your own function to modify the status, here is the description of that method
使用此过滤器:woocommerce_payment_complete_order_status
这篇关于WooCommerce 订单状态从支付网关更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!