Created
March 14, 2022 12:26
-
-
Save spirit1977/57f1496488e75f0255e92c20bef18022 to your computer and use it in GitHub Desktop.
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
//Anzeige Anzahl an Kundenbestellungen in WC Bestelldetails | |
add_action( 'woocommerce_admin_order_data_after_order_details', 'get_specific_customer_orders', 10, 1 ); | |
function get_specific_customer_orders( $order ) { | |
$customer_orders = get_posts( array( | |
'numberposts' => -1, | |
'meta_key' => '_billing_email', | |
'meta_value' => $order->get_billing_email(), | |
'post_type' => 'shop_order', | |
'post_status' => array('wc-completed'), | |
) ); | |
$orders_count = '<strong style="color:#ca4a1f">' . count($customer_orders) . '</strong>'; | |
echo'<br clear="all"> | |
<p>' . __( 'Anzahl an Bestellungen: ' ) . $orders_count . '</p>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment