title: Check if cart have active subscriptions in YITH WooCommerce Subscription Wordpress
body: <p>I am using YITH WooCommerce Subscription and I want to check if in my cart has subscription I want to disable one of my payment gateway. How could I do ?</p>
  
  <p>I already try this code but this is doesn't work.</p>
  
  <pre><code>add_filter( 'woocommerce_available_payment_gateways', 'filter_gateways', 1);
  function filter_gateways( $gateways ){
  
      if (has_woocommerce_subscription('','','active')) {
          unset( $gateways['pin_payments'] );
      }
      return $gateways; 
  }
  
  function has_woocommerce_subscription($the_user_id, $the_product_id, $the_status) {
      $current_user = wp_get_current_user();
      if (empty($the_user_id)) {
          $the_user_id = $current_user-&gt;ID;
      }
      if (WC_Subscriptions_Manager::user_has_subscription( $the_user_id, $the_product_id, $the_status)) {
          return true;
      }
  }
  </code></pre>