add custom columns to order list view

This commit is contained in:
Bilal Catic
2018-11-22 13:56:24 +01:00
parent 00f9d5cafa
commit a5419e2f3c
3 changed files with 73 additions and 1 deletions

View File

@@ -370,6 +370,25 @@ class Wiaas_Order {
return $response;
}
public static function get_order_customer_full_name($order_id){
$order = wc_get_order($order_id);
$customer_user_id = $order->get_customer_id();
$customer = get_userdata($customer_user_id);
return $customer->last_name . ' ' . $customer->first_name;
}
public static function get_order_commercial_lead_name($order_id){
$order = wc_get_order($order_id);
$commercial_lead_org_id = $order->get_meta('_wiaas_commercial_lead_id', true);
$commercial_lead_organization_info = wiaas_get_organization_info($commercial_lead_org_id);
return $commercial_lead_organization_info['name'];
}
public static function set_order_vat($order_id, $vat_code) {
add_post_meta($order_id, '_wiaas_vat_code', $vat_code);
}