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
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
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
Hi @inpsydekrystian,
thx for the Update. The Code works fine.
BR
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