wccs_custom_checkout_field_pro

The WooCommerce Checkout Manager wccs custom checkout field pro function.

Description

wccs_custom_checkout_field_pro( $checkout ); 

Parameters (1)

0. $checkout
The checkout.

Usage

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

Defined (1)

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

/includes/classes/main.php  
  1. function wccs_custom_checkout_field_pro( $checkout ) { 
  2. $options = get_option( 'wccs_settings' ); 
  3. if ( !empty($options['buttons'])) { 
  4. foreach ( $options['buttons'] as $btn ) : 
  5.  
  6. if ( $btn['type'] == 'heading' && empty($btn['deny_checkout'] ) ) { 
  7. echo '<h3 class="form-row '.$btn['position'].'" id="'.$btn['cow'].'_field">' . wpml_string_wccm_pro(''.$btn['label'].'') . '</h3>'; 
  8.  
  9.  
  10. if ( $btn['type'] == 'wooccmtext' ) { 
  11. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  12. 'type' => 'wooccmtext',  
  13. 'class' => array(''.$btn['position'].' '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  14. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  15. 'wooccm_required' => ''.$btn['checkbox'].'',  
  16. 'clear' => ''.$btn['clear_row'].'',  
  17. 'user_role' => ''.$btn['user_role'].'',  
  18. 'role_options' => ''.$btn['role_options'].'',  
  19. 'role_options2' => ''.$btn['role_options2'].'',  
  20. 'placeholder' => wpml_string_wccm_pro(''.$btn['placeholder'].''),  
  21.  
  22. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  23.  
  24.  
  25. if ( $btn['type'] == 'wooccmtextarea' ) { 
  26. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  27. 'type' => 'wooccmtextarea',  
  28. 'class' => array(''.$btn['position'].' wccs-form-row-wide '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  29. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  30. 'wooccm_required' => ''.$btn['checkbox'].'',  
  31. 'clear' => ''.$btn['clear_row'].'',  
  32. 'user_role' => ''.$btn['user_role'].'',  
  33. 'role_options' => ''.$btn['role_options'].'',  
  34. 'role_options2' => ''.$btn['role_options2'].'',  
  35. 'placeholder' => wpml_string_wccm_pro(''.$btn['placeholder'].''),  
  36.  
  37. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  38.  
  39.  
  40.  
  41. if ( $btn['type'] == 'colorpicker' ) { 
  42. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  43. 'type' => 'colorpicker',  
  44. 'class' => array(''.$btn['position'].' '.$btn['conditional_tie'].' wccs_colorpicker '.$btn['extra_class'].''),  
  45. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  46. 'wooccm_required' => ''.$btn['checkbox'].'',  
  47. 'clear' => ''.$btn['clear_row'].'',  
  48. 'user_role' => ''.$btn['user_role'].'',  
  49. 'role_options' => ''.$btn['role_options'].'',  
  50. 'role_options2' => ''.$btn['role_options2'].'',  
  51. 'placeholder' => wpml_string_wccm_pro(''.$btn['placeholder'].''),  
  52. 'color' => ''.$btn['colorpickerd'].'',  
  53. 'colorpickertype' => ''.$btn['colorpickertype'].'' 
  54.  
  55. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  56.  
  57.  
  58. if ( $btn['type'] == 'datepicker' ) { 
  59. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  60. 'type' => 'wooccmtext',  
  61. 'class' => array(''.$btn['position'].' MyDate'.$btn['cow'].' wccs-form-row-wide '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  62. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  63. 'wooccm_required' => ''.$btn['checkbox'].'',  
  64. 'user_role' => ''.$btn['user_role'].'',  
  65. 'role_options' => ''.$btn['role_options'].'',  
  66. 'role_options2' => ''.$btn['role_options2'].'',  
  67. 'clear' => ''.$btn['clear_row'].'',  
  68. 'placeholder' => wpml_string_wccm_pro(''.$btn['placeholder'].''),  
  69.  
  70. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  71.  
  72.  
  73. if ( $btn['type'] == 'time' ) { 
  74. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  75. 'type' => 'wooccmtext',  
  76. 'class' => array(''.$btn['position'].' MyTime'.$btn['cow'].' wccs-form-row-wide '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  77. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  78. 'wooccm_required' => ''.$btn['checkbox'].'',  
  79. 'user_role' => ''.$btn['user_role'].'',  
  80. 'role_options' => ''.$btn['role_options'].'',  
  81. 'role_options2' => ''.$btn['role_options2'].'',  
  82. 'clear' => ''.$btn['clear_row'].'',  
  83. 'placeholder' => wpml_string_wccm_pro(''.$btn['placeholder'].''),  
  84.  
  85. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  86.  
  87.  
  88. if ( $btn['type'] == 'checkbox_wccm' ) { 
  89. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  90. 'type' => 'checkbox_wccm',  
  91. 'class' => array(''.$btn['position'].' '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  92. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  93. 'user_role' => ''.$btn['user_role'].'',  
  94. 'role_options' => ''.$btn['role_options'].'',  
  95. 'role_options2' => ''.$btn['role_options2'].'',  
  96. 'wooccm_required' => ''.$btn['checkbox'].'',  
  97. 'clear' => ''.$btn['clear_row'].'',  
  98. 'options' => ''.$btn['option_array'].'',  
  99.  
  100. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  101.  
  102.  
  103. if ( $btn['type'] == 'wooccmpassword' ) { 
  104. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  105. 'type' => 'wooccmpassword',  
  106. 'class' => array(''.$btn['position'].' '.$btn['conditional_tie'].' '.$btn['extra_class'].' '.$btn['extra_class'].''),  
  107. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  108. 'wooccm_required' => ''.$btn['checkbox'].'',  
  109. 'user_role' => ''.$btn['user_role'].'',  
  110. 'role_options' => ''.$btn['role_options'].'',  
  111. 'role_options2' => ''.$btn['role_options2'].'',  
  112. 'clear' => ''.$btn['clear_row'].'',  
  113. 'placeholder' => ''.$btn['placeholder'].'',  
  114.  
  115. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  116.  
  117.  
  118. if ( $btn['type'] == 'wooccmradio' ) { 
  119. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  120. 'type' => 'wooccmradio',  
  121. 'class' => array(''.$btn['position'].' '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  122. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  123. 'wooccm_required' => ''.$btn['checkbox'].'',  
  124. 'default' => ''.$btn['force_title2'].'',  
  125. 'user_role' => ''.$btn['user_role'].'',  
  126. 'role_options' => ''.$btn['role_options'].'',  
  127. 'role_options2' => ''.$btn['role_options2'].'',  
  128. 'clear' => ''.$btn['clear_row'].'',  
  129. 'options' => ''.$btn['option_array'].'',  
  130.  
  131. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  132.  
  133.  
  134. if ( $btn['type'] == 'multiselect' ) { 
  135. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  136. 'type' => 'multiselect',  
  137. 'class' => array(''.$btn['position'].' '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  138. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  139. 'wooccm_required' => ''.$btn['checkbox'].'',  
  140. 'user_role' => ''.$btn['user_role'].'',  
  141. 'role_options' => ''.$btn['role_options'].'',  
  142. 'role_options2' => ''.$btn['role_options2'].'',  
  143. 'clear' => ''.$btn['clear_row'].'',  
  144. 'options' => ''.$btn['option_array'].'',  
  145.  
  146. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  147.  
  148.  
  149. if ( $btn['type'] == 'multicheckbox' ) { 
  150. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  151. 'type' => 'multicheckbox',  
  152. 'class' => array(''.$btn['position'].' '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  153. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  154. 'wooccm_required' => ''.$btn['checkbox'].'',  
  155. 'user_role' => ''.$btn['user_role'].'',  
  156. 'role_options' => ''.$btn['role_options'].'',  
  157. 'role_options2' => ''.$btn['role_options2'].'',  
  158. 'clear' => ''.$btn['clear_row'].'',  
  159. 'options' => ''.$btn['option_array'].'',  
  160.  
  161. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  162.  
  163.  
  164.  
  165.  
  166. if ( $btn['type'] == 'wooccmselect' ) { 
  167. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  168. 'type' => 'wooccmselect',  
  169. 'class' => array(''.$btn['position'].' '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  170. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  171. 'wooccm_required' => ''.$btn['checkbox'].'',  
  172. 'clear' => ''.$btn['clear_row'].'',  
  173. 'user_role' => ''.$btn['user_role'].'',  
  174. 'role_options' => ''.$btn['role_options'].'',  
  175. 'role_options2' => ''.$btn['role_options2'].'',  
  176. 'fancy' => ''.$btn['fancy'].'',  
  177. 'default' => ''.$btn['force_title2'].'',  
  178. 'options' => ''.$btn['option_array'].'',  
  179.  
  180. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  181.  
  182. if ( $btn['type'] == 'wooccmupload' ) { 
  183. woocommerce_form_field( ''.$btn['cow'].'' , array( 
  184. 'type' => 'wooccmupload',  
  185. 'placeholder' => ''.$btn['placeholder'].'',  
  186. 'class' => array(''.$btn['position'].' '.$btn['conditional_tie'].' '.$btn['extra_class'].''),  
  187. 'label' => wpml_string_wccm_pro(''.$btn['label'].''),  
  188. 'wooccm_required' => ''.$btn['checkbox'].'',  
  189. 'clear' => ''.$btn['clear_row'].'',  
  190. 'user_role' => ''.$btn['user_role'].'',  
  191. 'role_options' => ''.$btn['role_options'].'',  
  192. 'role_options2' => ''.$btn['role_options2'].'',  
  193. 'fancy' => ''.$btn['fancy'].'',  
  194. 'default' => ''.$btn['force_title2'].'',  
  195. 'options' => ''.$btn['option_array'].'',  
  196.  
  197. ), $checkout->get_value( ''.$btn['cow'].'' )); 
  198.  
  199. endforeach;