Skip to content

Change the status type for the cancellation process

Nicolas edited this page Feb 10, 2021 · 3 revisions

It is enough to add the status of the command that the plugin will have to cancel during its controls. Just paste this snippet into your functions.php file

function woa_custom_statustocancel_hook( $status ) {
	// More explication on WooCommerce status : https://docs.woocommerce.com/document/managing-orders/
	$status[] = 'wc-pending';
	$status[] = 'wc-on-hold';
	$status[] = 'wc-processing';
	//$status[] = 'wc-completed';
	//$status[] = 'wc-refunded';
	//$status[] = 'wc-failed';

	return $status;
}
add_filter( 'woo_cao_statustocancel', 'woa_custom_statustocancel_hook', 10, 1 );
Clone this wiki locally