• Resolved quantumtoast

    (@quantumtoast)


    Hi!

    For several versions now, I’ve had a SEPA direct debit button in the checkout alongside the PayPal and PayPal Pay Later buttons. I don’t have any alternative payment methods enabled in the settings. How can I remove this button? Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Krystian Syde

    (@inpsydekrystian)

    Hello @quantumtoast

    Currently as a workaround, you can use a filter that checks the context to conditionally show/hide the SEPA button on any given location:

    add_filter( 'woocommerce_paypal_payments_sdk_disabled_funding_hook', function( $disable_funding, $flags ) {  
        // Disable SEPA on product and cart pages, but keep it on checkout  
        if ( in_array( $flags['context'], array( 'product', 'cart' ), true ) ) {  
            $disable_funding[] = 'sepa';  
        }  
        return $disable_funding;  
    }, 10, 2 );
    

    But this button is “deprecated” and will be phased out in the coming months in favor of a separate SEPA method like the other APMS (it will also support subscriptions then). So it can be safely removed for now.

    Hope that helps. In case of troubles with implementing this, let us know.

    Kind regards,
    Krystian

    Thread Starter quantumtoast

    (@quantumtoast)

    Hi @inpsydekrystian ,

    thanks for the quick response and for the code. I need to remove the button from the checkout page as well, so I guess I just need to add “checkout” to the if condition?

    BR

    • This reply was modified 1 week, 1 day ago by quantumtoast.
    Plugin Support Krystian Syde

    (@inpsydekrystian)

    Hello @quantumtoast

    Yes, or just use this snippet below:

    add_filter( 'woocommerce_paypal_payments_sdk_disabled_funding_hook', function( $disable_funding, $flags ) {
    $disable_funding[] = 'sepa';
    return $disable_funding;
    }, 10, 2 );

    Sorry for sharing an incomplete snippet. I copied the last one I used and didn’t notice that the checkout part was missing. It would also work with checkout included, but it’s better to use the one above.

    Let us know how it goes!

    If this helped and you’re happy with the support, feel free to leave a quick review on WordPress. It means a lot to us and shows that we are needed as support.

    Kind regards,
    Krystian

    Thread Starter quantumtoast

    (@quantumtoast)

    Hi @inpsydekrystian,

    thx for the Update. The Code works fine.

    BR

    Plugin Support Krystian Syde

    (@inpsydekrystian)

    Hello @quantumtoast

    Glad its solved!

    If this helped and you’re happy with the support, feel free to leave a quick review on WordPress. It means a lot to us and shows that we are needed as support.

    Kind regards,
    Krystian

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.