remove_tax_for_exempt

The WooCommerce Checkout Manager remove tax for exempt function.

Description

remove_tax_for_exempt( $cart ); 

Parameters (1)

0. $cart
The cart.

Usage

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

Defined (1)

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

/includes/classes/main.php  
  1. function remove_tax_for_exempt( $cart ) { 
  2. global $woocommerce, $wpdb; 
  3.  
  4. $options = get_option( 'wccs_settings' ); 
  5. $options2 = get_option( 'wccs_settings2' ); 
  6. $options3 = get_option( 'wccs_settings3' ); 
  7.  
  8. $saved = WC()->session->get('wooccm_retain', array() ); 
  9.  
  10. if ( !empty($options['buttons']) ) { 
  11. foreach ( $options['buttons'] as $btn ) { 
  12. if ( !empty( $btn['tax_remove'] ) ) { 
  13. if ( $saved['wooccm_tax_save_method'] == $btn['chosen_valt'] ) { 
  14. $cart->remove_taxes(); 
  15.  
  16. if ( !empty($options3['billing_buttons']) ) { 
  17. foreach ( $options3['billing_buttons'] as $btn ) { 
  18. if ( !empty( $btn['tax_remove'] ) ) { 
  19. if ( $saved['wooccm_tax_save_method'] == $btn['chosen_valt'] ) { 
  20. $cart->remove_taxes(); 
  21.  
  22.  
  23. if ( !empty($options2['shipping_buttons']) ) { 
  24. foreach ( $options2['shipping_buttons'] as $btn ) { 
  25. if ( !empty( $btn['tax_remove'] ) ) { 
  26. if ( $saved['wooccm_tax_save_method'] == $btn['chosen_valt'] ) { 
  27. $cart->remove_taxes(); 
  28.  
  29. return $cart;