Support » Plugin: WooCommerce » Remove payment method for guests

  • Resolved Winnetou

    (@winnetou)


    Hi all,

    I want to remove the payment method BACS for guests in WooCommerce?
    Is it possible to create an remove action filter? Something like this for the BACS payment method:

    if ( !function_exists('is_user_logged_in') ) :
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
    
    endif;

    I don’t know where to start. I found some actions in class-wc-gateway-bacs.php:

    add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
    add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'save_account_details' ) );
    add_action( 'woocommerce_thankyou_bacs', array( $this, 'thankyou_page' ) );

    I hope you’ll help me.

    Many thanks for reading!

    https://wordpress.org/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove payment method for guests’ is closed to new replies.