Change COD default order status to “On Hold” instead of “Processing” in Woocommerce

前端 未结 3 961
情书的邮戳
情书的邮戳 2020-12-04 01:17

I need help with a problem-related to plugin \"WooCommerce Pay for Payment\" which counting some extra fee in shipping. Problem is, that this plugin sets automatically \"pro

3条回答
  •  春和景丽
    2020-12-04 01:27

    two solution above are same except:

    • the solution by @LoicTheAztek has 2 arguments in the core function and have a '10' hook priority
    • the solution by @Jiří-Prek has an arguments in the core function and have a '15' hook priority

    but for my WP5.1.1 and WC3.5.7

    function change_cod_payment_order_status( $order_status, $order ) {
    return 'on-hold';
    

    }

    generating an error

    PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function change_cod_payment_order_status()

    so I prefer use the code with only one argument in a main function

提交回复
热议问题