• Resolved kklo

    (@kklo)


    Hi,

    I am trying to Disable Payment by User Type in WooCommerce and found on the internet this code:

    function cwp_cash_delivery_disable_cliente( $available_gateways ) {
          global $woocommerce;
           
          if ( isset( $available_gateways['paypal'] ) && current_user_can('Cliente') ) {
                unset( $available_gateways['paypal'] );
          }
           
          return $available_gateways;
    }
    add_filter( 'woocommerce_available_payment_gateways', 'cwp_cash_delivery_disable_cliente' );

    but it’s not working.

    Can someone help me?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable Payment’ is closed to new replies.