Created
September 21, 2018 09:14
-
-
Save rwkyyy/80254548374ffeab7a95bec03e37f7c6 to your computer and use it in GitHub Desktop.
Show number of failed orders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_admin_order_data_after_order_details', 'failed_orders_evd', 10, 2 ); | |
function failed_orders_evd( $order ) { | |
$customer_orders = get_posts( array( | |
'numberposts' => -1, | |
// 'meta_key' => '_customer_user', | |
'meta_value' => $order->get_billing_email(), | |
'post_type' => 'shop_order', | |
'post_status' => array('wc-failed'), | |
) ); | |
$orders_count = '<strong style="color:red">' . count($customer_orders) . '</strong>'; | |
echo'<p>' . __( 'Failed orders: ' ) . $orders_count . '</p>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment