title: woocommerce conditional field
body: <p>I can not figure out how to activate the function when the user selects a field in the woocommerce checkout, this is my code, 
  I want it to be active only when the user selects 1 in the checkout selection fields</p>
  
  <pre><code>add_action( 'woocommerce_cart_calculate_fees','conditional_add_fee' );
  function conditional_add_fee() {
       global $woocommerce;
  
       if ( is_admin() &amp;&amp; ! defined( 'DOING_AJAX' ) )
            return;
       $subtotal = $woocommerce-&gt;cart-&gt;subtotal;
       $fee_percentage = 0.22; // 22 percent
       $fee = number_format( round( $subtotal * $fee_percentage, 2 ), 2 ); // rounded to two decimal places to match currency formatting
       $woocommerce-&gt;cart-&gt;add_fee( 'IVA', $fee, true, 'standard' );
  }
  </code></pre>
  
  <p>thanks</p>