WooParc_exportdata

Get export data.

Description

WooParc_exportdata( $order_id, (constant) $single = false, (constant) $quick = false ); 

Parameters (3)

0. $order_id
The order id.
1. $single — Optional. (constant) => false
The single.
2. $quick — Optional. (constant) => false
The quick.

Usage

  1. if ( !function_exists( 'WooParc_exportdata' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-postnl-parcelware/inc/funct-export.php'; 
  3.  
  4. // The order id. 
  5. $order_id = null; 
  6.  
  7. // The single. 
  8. $single = false; 
  9.  
  10. // The quick. 
  11. $quick = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = WooParc_exportdata($order_id, $single, $quick); 
  15.  

Defined (1)

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

/inc/funct-export.php  
  1. function WooParc_exportdata($order_id, $single=false, $quick=false) { 
  2. global $woocommerce; 
  3. $order = new WC_Order($order_id); 
  4.  
  5. $set_data=array(); 
  6.  
  7. $address=WooParc_make_address($order_id); 
  8.  
  9. if(!isset($address[1])) { $address[1]='';} 
  10. if(!isset($address[2])) { $address[2]='';} 
  11. if(!isset($address[3])) { $address[3]='';} 
  12.  
  13. $set_data['Contract']=__('PostNL Pakketten'); 
  14. $set_data['RecRef']=$order_id; 
  15. $set_data['Rec_Companyname']=$order->shipping_company; 
  16. $set_data['Rec_Firstname']=$order->shipping_first_name.' '; 
  17. $set_data['Rec_Lastname']=$order->shipping_last_name; 
  18. $set_data['Street']=$address[0]; 
  19. $set_data['Homenumber']=$address[1]; 
  20. $set_data['Homenumber_ext']=$address[2]; 
  21. $set_data['Building']=$address[3]; 
  22. $set_data['Postcode']=$order->shipping_postcode; 
  23. $set_data['City']=$order->shipping_city; 
  24. $set_data['Region']=$order->shipping_state; 
  25. if(!isset($order->shipping_country) || $order->shipping_country=="") $order->shipping_country=$order->billing_country; 
  26. if($order->shipping_country=="") $order->shipping_country=get_option( 'woocommerce_default_country'); 
  27. $full_country=__($woocommerce->countries->countries[$order->shipping_country], 'woocommerce'); 
  28. $set_data['Country']=$full_country; 
  29. $set_data['Phone']=$order->billing_phone; 
  30. $set_data['Email']=$order->billing_email; 
  31. $set_data['ShipmentCount']='1'; 
  32. $set_data['ShipRemark']=$order->customer_note; 
  33. $set_data['RefNr']=$set_data['Ordernumber']=$order_id; 
  34. $set_data['CostCentre']=$set_data['SendRef']=$set_data['ClientRef']=$set_data['Door']=$set_data['Floor']=$set_data['Department']=$set_data['District']=$set_data['Mobile']= $set_data['XML']=$set_data['Sen_IBAN']= $set_data['Sen_Name']=$set_data['Barcode']=''; 
  35.  
  36. // Check if shipping cost are same or above minimum shipping cost 
  37. if(WooParc_checkexport($order, $single, $quick)) { 
  38. return array($set_data['RefNr'], $set_data['SendRef'], $set_data['ClientRef'], $set_data['Contract'], $set_data['RecRef'], $set_data['Rec_Companyname'], $set_data['Rec_Firstname'], $set_data['Rec_Lastname'], $set_data['Street'], $set_data['Homenumber'], $set_data['Homenumber_ext'], $set_data['Building'], $set_data['Door'], $set_data['Floor'], $set_data['Department'], $set_data['Postcode'], $set_data['City'], $set_data['District'], $set_data['Region'], $set_data['Country'], $set_data['Phone'], $set_data['Mobile'], $set_data['Email'], $set_data['XML'], $set_data['Sen_IBAN'], $set_data['Sen_Name'], $set_data['ShipmentCount'], $set_data['ShipRemark'], $set_data['CostCentre'], $set_data['Ordernumber'], $set_data['Barcode']); 
  39. } else { 
  40. return false;