wcdn_get_order_info

Get the order info fields.

Description

wcdn_get_order_info( $order ); 

Parameters (1)

0. $order
The order.

Usage

  1. if ( !function_exists( 'wcdn_get_order_info' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-print-invoice-delivery-note/includes/wcdn-template-functions.php'; 
  3.  
  4. // The order. 
  5. $order = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wcdn_get_order_info($order); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wcdn-template-functions.php  
  1. function wcdn_get_order_info( $order ) { 
  2. global $wcdn; 
  3. $fields = array(); 
  4. $create_invoice_number = get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'create_invoice_number' ); 
  5.  
  6. if( wcdn_get_template_type() == 'invoice' && !empty( $create_invoice_number ) ) { 
  7. $fields['invoice_number'] = array(  
  8. 'label' => __( 'Invoice Number', 'woocommerce-delivery-notes' ),  
  9. 'value' => wcdn_get_order_invoice_number( $order->id ) 
  10. ); 
  11.  
  12. $fields['order_number'] = array(  
  13. 'label' => __( 'Order Number', 'woocommerce-delivery-notes' ),  
  14. 'value' => $order->get_order_number()  
  15. ); 
  16.  
  17. $fields['order_date'] = array(  
  18. 'label' => __( 'Order Date', 'woocommerce-delivery-notes' ),  
  19. 'value' => date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ) 
  20. ); 
  21.  
  22. $fields['payment_method'] = array(  
  23. 'label' => __( 'Payment Method', 'woocommerce-delivery-notes' ),  
  24. 'value' => __( $order->payment_method_title, 'woocommerce' ) 
  25. ); 
  26.  
  27. if( $order->billing_email ) { 
  28. $fields['billing_email'] = array( 
  29. 'label' => __( 'Email', 'woocommerce-delivery-notes' ),  
  30. 'value' => $order->billing_email 
  31. ); 
  32.  
  33. if( $order->billing_phone ) { 
  34. $fields['billing_phone'] = array( 
  35. 'label' => __( 'Telephone', 'woocommerce-delivery-notes' ),  
  36. 'value' => $order->billing_phone 
  37. ); 
  38.  
  39. return $fields;