remove_fields_filter3

The WooCommerce Checkout Manager remove fields filter3 function.

Description

remove_fields_filter3( $fields ); 

Parameters (1)

0. $fields
The fields.

Usage

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

Defined (1)

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

/includes/classes/main.php  
  1. function remove_fields_filter($fields) { 
  2. global $woocommerce; 
  3. $options = get_option( 'wccs_settings' ); 
  4.  
  5. foreach ($woocommerce->cart->cart_contents as $key => $values ) { 
  6.  
  7. $multiCategoriesx = $options['checkness']['productssave']; 
  8. $multiCategoriesArrayx = explode(', ', $multiCategoriesx); 
  9.  
  10. if(in_array($values['product_id'], $multiCategoriesArrayx) && ($woocommerce->cart->cart_contents_count < 2) ) { 
  11. unset($fields['billing']['billing_address_1']); 
  12. unset($fields['billing']['billing_address_2']); 
  13. unset($fields['billing']['billing_phone']); 
  14. unset($fields['billing']['billing_country']); 
  15. unset($fields['billing']['billing_city']); 
  16. unset($fields['billing']['billing_postcode']); 
  17. unset($fields['billing']['billing_state']);