title: WooCommerce: Change payment gateway if Cart Total amount = 0
body: <p>I want users to have a free checkout for my subscription service if they have 100% discount coupon code for the product. So if cart total gets equal to zero, then there should be no payment gateway and users should be able to signup directly.</p>
  
  <p>I think WooCommerce don't allow working without payment gateway or can be difficult to modify, so I want to change the current payment gateway to "Cash on Delivery" if cart total equals to 0 . I shall change Cash on delivery text to something else later.</p>
  
  <p>Here is link to my dummy development. 
  Use Couponcode: abcd1234
  Here is the function that I'm using to hide payment gateways in my functions.php file :</p>
  
  <pre><code>add_filter( 'woocommerce_available_payment_gateways', 'paypal_100' );
  function paypal_100($available_gateways) {
        if ( WC()-&gt;cart-&gt;total == '0' ) {
            unset( $available_gateways);
        }
  return $available_gateways;
  }
  </code></pre>
  
  <p>Thanks in advance,
  Yash</p>