wccs_custom_checkout_field_pro_process

The WooCommerce Checkout Manager wccs custom checkout field pro process function.

Description

wccs_custom_checkout_field_pro_process(); 

Usage

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

Defined (1)

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

/includes/classes/main.php  
  1. function wccs_custom_checkout_field_pro_process() { 
  2. global $woocommerce; 
  3.  
  4. $options = get_option( 'wccs_settings' ); 
  5.  
  6. foreach ( $options['buttons'] as $btn ) : 
  7.  
  8. if( $btn['checkbox'] === 'true' ) { 
  9. // without checkbox 
  10. if ( empty($btn['single_px_cat']) && empty($btn['single_p_cat']) && empty($btn['single_px']) && empty($btn['single_p']) && !empty( $btn['label'] ) && $btn['type'] !== 'wooccmupload' && $btn['type'] !== 'changename' && ($btn['type'] !== 'heading') ) { 
  11. if (!$_POST[''.$btn['cow'].''] ) { 
  12. wc_add_notice( '<strong>'.wpml_string_wccm_pro($btn['label']).'</strong> '.wpml_string_wccm_pro('is a required field.').'' , error); 
  13.  
  14. // checkbox 
  15. if ( empty($btn['single_px_cat']) && empty($btn['single_p_cat']) && empty($btn['single_px']) && empty($btn['single_p']) && $btn['type'] == 'checkbox' && !empty( $btn['label'] ) && $btn['type'] !== 'changename' && $btn['type'] !== 'wooccmupload' && ($btn['type'] !== 'heading') ) { 
  16. if ( ($_POST[ ''.$btn['cow'].'' ] == ''.$btn['check_2'].'') && (!empty ($btn['checkbox']) ) ) { 
  17. wc_add_notice( '<strong>'.wpml_string_wccm_pro($btn['label']).'</strong> '.wpml_string_wccm_pro('is a required field.').'', error); 
  18. }  
  19.  
  20. endforeach;