1. Home
  2. Docs
  3. Cost & Reports
  4. Usage
  5. Reports – hook to remove statuses

Reports – hook to remove statuses

Cost & Reports is integrated with Order status manager for WooCommerce, but if you do not have this and just want to remove some statuses from the reports, here is how to do that. (PHP code)

/**
* Hook into order statuses and remove some of them
*/
function cas_set_order_statuses($statuses){
	
	
	unset($statuses['wc-on-hold']);//can be removed
	unset($statuses['wc-pending']);//can be removed

	return $statuses; //do not remove this line
	
}
add_filter('cyp_order_statuses', 'cas_set_order_statuses');

Add this code to your functions.php file or install a plugin like Snippets and add this code for admin area. See image how to do this:

How can we help?