Provides an instant overview of your shop's current customers and the contents of their carts.
Since version 4.0 of the official WooCommerce Stripe plugin, it started injecting a Buy Now button into cart templates. This button utilizes the new Payment Request API in supporting browsers. Although this is a very interesting technical advancement, it’s likely that your shop isn’t ready for it. On this very site for instance, I’m requiring additional fields to be filled during checkout and completing an order without those would cause problems. To (temporarily) disable this new feature, I’ve assembled the following snippet.
add_action( 'plugins_loaded', function() {
if ( class_exists( 'WC_Stripe_Payment_Request' ) && is_callable( array( 'WC_Stripe_Payment_Request', 'instance' ) ) ) {
remove_action( 'woocommerce_proceed_to_checkout', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html' ), 1 );
remove_action( 'woocommerce_proceed_to_checkout', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html' ), 2 );
}
}, 11 );
As mentioned in the comments you can also disable this button in the Stripe plugin settings. See WooCommerce > Settings > Checkout > Stripe > “Payment Request Buttons”
Posted by Berend on
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
There is a setting on the WC Stripe settings screen that allows this button to be disabled.
Actually found that out after writing the article…!
I’ve been looking for hours for this WC Stripe seeting that disables this button. Can you please share specific instructions about where to find this setting? Maybe even a screenshot?
That would be under WooCommerce > Settings > Checkout > Stripe > “Payment Request Buttons”.
I’m glad the comments mention the setting – Berend would you amend/update this article to include a screenshot of that setting so people can find it easier? I think this would confuse / intimidate many people who want to use Stripe as a simple payment processor and then think they have to figure out where to put some scary piece of code to turn off a button they don’t want.
Article now updated!
Is there way to swap the position of the request payment buttons? I would like the button under the proceed to checkout instead of it being first?