title: Woocommerce hide payment gateway for user roles
body: <p>Hey guys I have a cash on delivery payment method on my wordpress/woocomerce website that I want to hide from the customer user role and non-logged in users. </p>
  
  <p>I've been searching up and down and the only thing I found close was this bit of code.</p>
  
  <pre><code>function paypal_disable_manager( $available_gateways ) 
  
  {global $woocommerce;
  
  if ( isset( $available_gateways['paypal'] ) &amp;&amp; current_user_can('customer') ) {
  
  unset( $available_gateways['paypal'] );
  
  }
  
  return $available_gateways;
  
  }
  
  add_filter( 'woocommerce_available_payment_gateways','paypal_disable_manager' );
  </code></pre>
  
  <p>Would someone be able to help me modify this code to make it work for my use. Thank you in advance!</p>