customer_user

This commit is contained in:
Mike Jolley 2016-08-05 16:09:40 +01:00
parent 007a767657
commit 0a0330bac0
9 changed files with 16 additions and 16 deletions

View File

@ -219,10 +219,10 @@ class WC_Meta_Box_Order_Data {
<p class="form-field form-field-wide wc-customer-user">
<label for="customer_user"><?php _e( 'Customer:', 'woocommerce' ) ?> <?php
if ( ! empty( $order->customer_user ) ) {
if ( ! empty( $order->get_user_id() ) ) {
$args = array( 'post_status' => 'all',
'post_type' => 'shop_order',
'_customer_user' => absint( $order->customer_user )
'_customer_user' => absint( $order->get_user_id() )
);
printf( '<a href="%s">%s &rarr;</a>',
esc_url( add_query_arg( $args, admin_url( 'edit.php' ) ) ),
@ -233,8 +233,8 @@ class WC_Meta_Box_Order_Data {
<?php
$user_string = '';
$user_id = '';
if ( ! empty( $order->customer_user ) ) {
$user_id = absint( $order->customer_user );
if ( ! empty( $order->get_user_id() ) ) {
$user_id = absint( $order->get_user_id() );
$user = get_user_by( 'id', $user_id );
$user_string = esc_html( $user->display_name ) . ' (#' . absint( $user->ID ) . ' &ndash; ' . esc_html( $user->user_email ) . ')';
}

View File

@ -149,7 +149,7 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller {
'payment_method_title' => $order->get_payment_method_title(),
'transaction_id' => $order->get_transaction_id(),
'customer_ip_address' => $order->customer_ip_address,
'customer_user_agent' => $order->customer_user_agent,
'customer_user_agent' => $order->get_user_id()_agent,
'created_via' => $order->created_via,
'customer_note' => $order->customer_note,
'date_completed' => wc_rest_prepare_date_response( $order->completed_date ),

View File

@ -359,7 +359,7 @@ class WC_API_Customers extends WC_API_Resource {
*/
public function add_customer_data( $order_data, $order ) {
if ( 0 == $order->customer_user ) {
if ( 0 == $order->get_user_id() ) {
// add customer data from order
$order_data['customer'] = array(
@ -395,7 +395,7 @@ class WC_API_Customers extends WC_API_Resource {
} else {
$order_data['customer'] = current( $this->get_customer( $order->customer_user ) );
$order_data['customer'] = current( $this->get_customer( $order->get_user_id() ) );
}
return $order_data;

View File

@ -163,8 +163,8 @@ class WC_API_Orders extends WC_API_Resource {
),
'note' => $order->customer_note,
'customer_ip' => $order->customer_ip_address,
'customer_user_agent' => $order->customer_user_agent,
'customer_id' => $order->customer_user,
'customer_user_agent' => $order->get_user_id()_agent,
'customer_id' => $order->get_user_id(),
'view_order_url' => $order->get_view_order_url(),
'line_items' => array(),
'shipping_lines' => array(),

View File

@ -622,7 +622,7 @@ class WC_API_Customers extends WC_API_Resource {
*/
public function add_customer_data( $order_data, $order ) {
if ( 0 == $order->customer_user ) {
if ( 0 == $order->get_user_id() ) {
// add customer data from order
$order_data['customer'] = array(
@ -658,7 +658,7 @@ class WC_API_Customers extends WC_API_Resource {
} else {
$order_data['customer'] = current( $this->get_customer( $order->customer_user ) );
$order_data['customer'] = current( $this->get_customer( $order->get_user_id() ) );
}
return $order_data;

View File

@ -201,7 +201,7 @@ class WC_API_Orders extends WC_API_Resource {
),
'note' => $order->customer_note,
'customer_ip' => $order->customer_ip_address,
'customer_user_agent' => $order->customer_user_agent,
'customer_user_agent' => $order->get_user_id()_agent,
'customer_id' => $order->get_user_id(),
'view_order_url' => $order->get_view_order_url(),
'line_items' => array(),

View File

@ -611,7 +611,7 @@ class WC_API_Customers extends WC_API_Resource {
*/
public function add_customer_data( $order_data, $order ) {
if ( 0 == $order->customer_user ) {
if ( 0 == $order->get_user_id() ) {
// add customer data from order
$order_data['customer'] = array(
@ -647,7 +647,7 @@ class WC_API_Customers extends WC_API_Resource {
} else {
$order_data['customer'] = current( $this->get_customer( $order->customer_user ) );
$order_data['customer'] = current( $this->get_customer( $order->get_user_id() ) );
}
return $order_data;

View File

@ -207,7 +207,7 @@ class WC_API_Orders extends WC_API_Resource {
),
'note' => $order->customer_note,
'customer_ip' => $order->customer_ip_address,
'customer_user_agent' => $order->customer_user_agent,
'customer_user_agent' => $order->get_user_id()_agent,
'customer_id' => $order->get_user_id(),
'view_order_url' => $order->get_view_order_url(),
'line_items' => array(),

View File

@ -676,7 +676,7 @@ class WC_CLI_Order extends WC_CLI_Command {
),
'note' => $order->customer_note,
'customer_ip' => $order->customer_ip_address,
'customer_user_agent' => $order->customer_user_agent,
'customer_user_agent' => $order->get_user_id()_agent,
'customer_id' => $order->get_user_id(),
'view_order_url' => $order->get_view_order_url(),
'line_items' => array(),