在WooCommerce中自动处理已付款的订单,而不是自动完成 [英] Auto process paid orders instead of auto complete in WooCommerce

查看:69
本文介绍了在WooCommerce中自动处理已付款的订单,而不是自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在woocommerce中有2个支付网关,货到付款和信用卡.

I have 2 payment gateways in woocommerce, cash on delivery and credit card.

客户用现金发送订单后,我得到订单状态进行处理.但是,当他们用信用卡付款并且付款成功后,订单状态便完成了.

After the client sends the order with cash, i get the order status to processing. BUT, after they pay with credit card and payment is succesfull the order status goes to complete.

用卡付款后,如何使订单状态显示正在处理?并且只有在他们收到货物后,商店经理才能将订单状态设置为完成.

How can i make the order status to say processing after they paid with the card? And only after they received the goods, the shop manager can set the order status to complete.

推荐答案

尝试使用以下内容,默认情况下会将已付款订单状态设置为处理":

Try to use the following, which will set paid orders status to processing by default:

add_action( 'woocommerce_payment_complete_order_status', 'wc_auto_complete_paid_order', 10, 3 );
function wc_auto_complete_paid_order( $status, $order_id, $order ) {
    return 'processing';
}

代码进入活动子主题(或活动主题)的functions.php文件中.

Code goes in functions.php file of the active child theme (or active theme).

相关: WooCommerce:自动完成付费订单

这篇关于在WooCommerce中自动处理已付款的订单,而不是自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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