hello i have this code
//define the woocommerce_valid_order_statuses_for_cancel callback
add_filter( 'woocommerce_valid_order_statuses_for_cancel', 'custom_valid_order_statuses_for_cancel',1, 2 );
function custom_valid_order_statuses_for_cancel( $statuses, $order ){
// Set HERE the order statuses where you want the cancel button to appear
return array_merge( $statuses, array('processing', 'shipped'));
}
it shows order cancel button when order status is processing or shipped it's great but when i click the cancel button it redirect me to a blank page with this in the url
and the order doesn't cancel any ideas what i am doing wrong ?
EDIT 1: i opened the network tab and i get Status Code: 500 Internal Server Error when i click the cancel button what's causing this problem?
EDIT 2 : i tried deactivating all the plugins except woocommerce but still doesn't work