WordPress at Your Fingertips
function is not described

WC_Gateway_COD::change_payment_complete_order_status() public WC 3.1.0

Change payment complete order status to completed for COD orders.

{} It's a method of the class: WC_Gateway_COD{}

No Hooks.

Return

String.

Usage

$WC_Gateway_COD = new WC_Gateway_COD();
$WC_Gateway_COD->change_payment_complete_order_status( $status, $order_id, $order );
$status(string) (required)
Current order status.
$order_id(int)
Order ID.
$order(WC_Order|false)
Order object.
Default: false

Changelog

Since 3.1.0 Introduced.

Code of WC_Gateway_COD::change_payment_complete_order_status() WC 5.7.1

public function change_payment_complete_order_status( $status, $order_id = 0, $order = false ) {
	if ( $order && 'cod' === $order->get_payment_method() ) {
		$status = 'completed';
	}
	return $status;
}