wccs_custom_checkout_details_pro

The WooCommerce Checkout Manager wccs custom checkout details pro function.

Description

wccs_custom_checkout_details_pro( $order ); 

Parameters (1)

0. $order
The order.

Usage

  1. if ( !function_exists( 'wccs_custom_checkout_details_pro' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-checkout-manager/includes/classes/main.php'; 
  3.  
  4. // The order. 
  5. $order = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wccs_custom_checkout_details_pro($order); 
  9.  

Defined (1)

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

/includes/classes/main.php  
  1. function wccs_custom_checkout_details_pro( $order) { 
  2.  
  3.  
  4. $shipping = array( 'country', 'first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'state', 'postcode' ); 
  5. $billing = array( 'country', 'first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'state', 'postcode', 'email', 'phone' ); 
  6.  
  7. $names = array( 'billing', 'shipping' ); 
  8. $inc = 3; 
  9.  
  10. if ( defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '2.3', '>=' ) ) { 
  11. foreach( $names as $name ) { 
  12.  
  13. $array = ($name == 'billing') ? $billing : $shipping; 
  14.  
  15. $options = get_option( 'wccs_settings'.$inc.'' ); 
  16.  
  17. foreach ( $options[''.$name.'_buttons'] as $btn ) : 
  18.  
  19.  
  20. if ( !in_array( $btn['cow'], $array ) ) { 
  21. if ( (''.get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true).'' !== '') && !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] !== 'heading') && $btn['type'] !== 'wooccmupload' && ($btn['type'] !== 'multiselect') && ($btn['type'] !== 'multicheckbox') ) { 
  22. echo '<tr><th>'.wpml_string_wccm_pro($btn['label']).':</th> <td>'.nl2br(get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true)).'</td></tr>'; 
  23.  
  24. } elseif ( !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] == 'heading') && ($btn['type'] !== 'multiselect') && ($btn['type'] !== 'multicheckbox') ) { 
  25. echo '<tr><th colspan="2">' .wpml_string_wccm_pro($btn['label']). '</th><td></td></tr>'; 
  26.  
  27. } elseif ( (''.get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true).'' !== '') && $btn['type'] !== 'wooccmupload' && !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] !== 'heading') && (($btn['type'] == 'multiselect') || ($btn['type'] == 'multicheckbox')) ) { 
  28. $strings = unserialize(get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true)); 
  29. echo '<tr><th>'.wpml_string_wccm_pro($btn['label']).':</th>'; 
  30.  
  31. foreach($strings as $key ) { 
  32. echo '<td data-title="' .wpml_string_wccm_pro($btn['label']). '">'.wpml_string_wccm_pro($key).'</td>'; 
  33. echo '</tr>'; 
  34. }elseif( $btn['type'] == 'wooccmupload' ) { 
  35. $info = explode("||", get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true)); 
  36. echo '<tr><th>'.wpml_string_wccm_pro($btn['force_title2']).':</th> <td>'.$info[0].'</td></tr>'; 
  37. endforeach; 
  38. $inc--; 
  39.  
  40. $options = get_option( 'wccs_settings' ); 
  41.  
  42. foreach ( $options['buttons'] as $btn ) : 
  43.  
  44. if ( (''.get_post_meta( $order->id , ''.$btn['cow'].'', true).'' !== '') && !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] !== 'heading') && $btn['type'] !== 'wooccmupload' && ($btn['type'] !== 'multiselect') && ($btn['type'] !== 'multicheckbox') ) { 
  45. echo '<tr><th>'.wpml_string_wccm_pro($btn['label']).':</th><td data-title="' .wpml_string_wccm_pro($btn['label']). '">'.nl2br(get_post_meta( $order->id , ''.$btn['cow'].'', true)).'</td></tr>'; 
  46.  
  47. } elseif ( !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] == 'heading') && $btn['type'] !== 'wooccmupload' && ($btn['type'] !== 'multiselect') && ($btn['type'] !== 'multicheckbox') ) { 
  48. echo '<tr><th colspan="2">' .wpml_string_wccm_pro($btn['label']). '</th><td></td></tr>'; 
  49.  
  50. } elseif ( (''.get_post_meta( $order->id , ''.$btn['cow'].'', true).'' !== '') && !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] !== 'heading') && $btn['type'] !== 'wooccmupload' && (($btn['type'] == 'multiselect') || ($btn['type'] == 'multicheckbox')) ) { 
  51. $strings = unserialize(get_post_meta( $order->id , ''.$btn['cow'].'', true)); 
  52. echo '<tr><th>'.wpml_string_wccm_pro($btn['label']).':</th>'; 
  53.  
  54. foreach($strings as $key ) { 
  55. echo '<td data-title="' .wpml_string_wccm_pro($btn['label']). '">'.wpml_string_wccm_pro($key).'</td>'; 
  56. echo '</tr>'; 
  57. }elseif( $btn['type'] == 'wooccmupload' ) { 
  58. $info = explode("||", get_post_meta( $order->id , ''.$btn['cow'].'', true)); 
  59. echo '<tr><th>'.wpml_string_wccm_pro($btn['force_title2']).':</th><td data-title="' .wpml_string_wccm_pro($btn['force_title2']). '">'.$info[0].'</td></tr>'; 
  60. endforeach; 
  61. } else { 
  62. foreach( $names as $name ) { 
  63.  
  64. $array = ($name == 'billing') ? $billing : $shipping; 
  65.  
  66. $options = get_option( 'wccs_settings'.$inc.'' ); 
  67.  
  68. foreach ( $options[''.$name.'_buttons'] as $btn ) : 
  69.  
  70.  
  71. if ( !in_array( $btn['cow'], $array ) ) { 
  72. if ( (''.get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true).'' !== '') && !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] !== 'heading') && ($btn['type'] !== 'multiselect') && $btn['type'] !== 'wooccmupload' && ($btn['type'] !== 'multicheckbox') ) { 
  73. echo '<dt>'.wpml_string_wccm_pro($btn['label']).':</dt> <dd>'.nl2br(get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true)).'</dd>'; 
  74.  
  75. } elseif ( !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] == 'heading') && ($btn['type'] !== 'multiselect') && ($btn['type'] !== 'multicheckbox') ) { 
  76. echo '<h2>' .wpml_string_wccm_pro($btn['label']). '</h2>'; 
  77.  
  78. } elseif ( (''.get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true).'' !== '') && !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] !== 'heading') && (($btn['type'] == 'multiselect') || ($btn['type'] == 'multicheckbox')) ) { 
  79. $strings = unserialize(get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true)); 
  80. echo '<dt>'.wpml_string_wccm_pro($btn['label']).':</dt><dd>'; 
  81.  
  82. foreach($strings as $key ) { 
  83. echo ''.wpml_string_wccm_pro($key).', '; 
  84. echo '</dd>'; 
  85. }elseif( $btn['type'] == 'wooccmupload' ) { 
  86. $info = explode("||", get_post_meta( $order->id , '_'.$name.'_'.$btn['cow'].'', true)); 
  87. echo '<dt>'.wpml_string_wccm_pro($btn['force_title2']).':</dt> <dd>'.$info[0].'</dd>'; 
  88. endforeach; 
  89. $inc--; 
  90.  
  91. $options = get_option( 'wccs_settings' ); 
  92.  
  93. foreach ( $options['buttons'] as $btn ) : 
  94.  
  95. if ( (''.get_post_meta( $order->id , ''.$btn['cow'].'', true).'' !== '') && !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] !== 'heading') && ($btn['type'] !== 'wooccmupload' && $btn['type'] !== 'multiselect') && ($btn['type'] !== 'multicheckbox') ) { 
  96. echo '<dt>'.wpml_string_wccm_pro($btn['label']).':</dt> <dd>'.nl2br(get_post_meta( $order->id , ''.$btn['cow'].'', true)).'</dd>'; 
  97.  
  98. } elseif ( !empty( $btn['label'] ) && $btn['type'] !== 'wooccmupload' && empty( $btn['deny_receipt'] ) && ($btn['type'] == 'heading') && ($btn['type'] !== 'multiselect') && ($btn['type'] !== 'multicheckbox') ) { 
  99. echo '<h2>' .wpml_string_wccm_pro($btn['label']). '</h2>'; 
  100.  
  101. } elseif ( (''.get_post_meta( $order->id , ''.$btn['cow'].'', true).'' !== '') && !empty( $btn['label'] ) && empty( $btn['deny_receipt'] ) && ($btn['type'] !== 'heading') && $btn['type'] !== 'wooccmupload' && (($btn['type'] == 'multiselect') || ($btn['type'] == 'multicheckbox')) ) { 
  102. $strings = unserialize(get_post_meta( $order->id , ''.$btn['cow'].'', true)); 
  103. echo '<dt>'.wpml_string_wccm_pro($btn['label']).':</dt><dd>'; 
  104.  
  105. foreach($strings as $key ) { 
  106. echo ''.wpml_string_wccm_pro($key).', '; 
  107. echo '</dd>'; 
  108. }elseif( $btn['type'] == 'wooccmupload' ) { 
  109. $info = explode("||", get_post_meta( $order->id , ''.$btn['cow'].'', true)); 
  110. echo '<dt>'.wpml_string_wccm_pro($btn['force_title2']).':</dt> <dd>'.$info[0].'</dd>'; 
  111. endforeach; 
  112.