For user order item information
-
Hello,
I am using a php plugin to write php in a page that I need.
Is there a nice and clean way to get the item information for a user ?I am using a foreach since there will be more users in the long term.
this is what I have now :
<?php // Array of stdClass objects. foreach ( $alleKlanten as $user ) { echo '<span>' . esc_html( $user->display_name ) . '</span>'; $customer_orders = get_posts( array( 'numberposts' => -1, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => "shop_order", 'post_status' => array_keys( wc_get_order_statuses() ), ) ); echo "<hr>"; /** * Verkrijg hier alle order informatie die is doorgezet. */ foreach ($customer_orders as $order) { var_dump( $wpdb->get_results( "SELECT * FROM wp_woocommerce_order_items WHERE order_id = {$order->ID} " )); } } ?>It does return nothing.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘For user order item information’ is closed to new replies.