WCB_Contact_XML_Document

The WooCommerce Billogram Integration WCB Contact XML Document class.

Defined (1)

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

/class-billogram2-contact-xml.php  
  1. class WCB_Contact_XML_Document extends WCB_XML_Document{ 
  2.  
  3. /** 
  4. */ 
  5. function __construct() { 
  6. parent::__construct(); 
  7.  
  8. /** 
  9. * Creates an XML representation of an order 
  10. * @access public 
  11. * @param mixed $arr 
  12. * @return mixed 
  13. */ 
  14. public function create($arr) { 
  15. $contact = array(); 
  16. if($arr->billing_company) { 
  17. $contact['name'] = $arr->billing_company; 
  18. }else{ 
  19. $contact['name'] = $arr->billing_first_name . " " . $arr->billing_last_name; 
  20. //logthis('Contact name:'. $contact['name']) 
  21. $contact['contact']['name'] = $arr->billing_first_name . " " . $arr->billing_last_name; 
  22. $contact['contact']['email'] = $arr->billing_email; 
  23. $contact['contact']['phone'] = $arr->billing_phone; 
  24. $contact['address']['street_address'] = $arr->billing_address_1; 
  25. $contact['address']['zipcode'] = $arr->billing_postcode; 
  26. $contact['address']['city'] = $arr->billing_city; 
  27. $contact['address']['country'] = $arr->billing_country; 
  28. $contact['delivery_address']['street_address'] = $arr->shipping_address_1; 
  29. $contact['delivery_address']['zipcode'] = $arr->shipping_postcode; 
  30. $contact['delivery_address']['city'] = $arr->shipping_city; 
  31. $contact['delivery_address']['country'] = $arr->shipping_country; 
  32. if($arr->billing_company) { 
  33. $contact['company_type'] = 'business'; 
  34. }else{ 
  35. $contact['company_type'] = 'individual'; 
  36.  
  37. //$contact['PriceList'] = 'A'; 
  38. //$root = 'Customer'; 
  39. //return $this->generate($root, $contact); 
  40. return $contact; 
  41.  
  42. public function update($arr, $custome_no) { 
  43. $contact = array(); 
  44. $contact['customer_no'] = $custome_no; 
  45. $contact['name'] = $arr->billing_first_name . " " . $arr->billing_last_name; 
  46. $contact['contact']['name'] = $arr->billing_first_name . " " . $arr->billing_last_name; 
  47. $contact['contact']['email'] = $arr->billing_email; 
  48. $contact['contact']['phone'] = $arr->billing_phone; 
  49. $contact['address']['street_address'] = $arr->billing_address_1; 
  50. $contact['address']['zipcode'] = $arr->billing_postcode; 
  51. $contact['address']['city'] = $arr->billing_city; 
  52. $contact['address']['country'] = $arr->billing_country; 
  53. $contact['delivery_address']['street_address'] = $arr->shipping_address_1; 
  54. $contact['delivery_address']['zipcode'] = $arr->shipping_postcode; 
  55. $contact['delivery_address']['city'] = $arr->shipping_city; 
  56. $contact['delivery_address']['country'] = $arr->shipping_country; 
  57. $contact['company_type'] = 'individual'; 
  58. //$contact['PriceList'] = 'A'; 
  59. //$root = 'Customer'; 
  60. //return $this->generate($root, $contact); 
  61. return $contact;