Remove the Apple Pay button in Stripe on the WooCommerce product page.
<?php
/**
* Remove Apple Pay button
*
* @return bool
*/
function remove_stripe_apple_pay_button() {
$apple_pay_instance = WC_Stripe_Apple_Pay::instance();
// Check WooCommerce retro-compatibility.
if ( version_compare( WC_VERSION, '3.0.0', '<' ) ) {
return remove_action( 'woocommerce_after_add_to_cart_button', array( $apple_pay_instance, 'display_apple_pay_button' ), 1 );
} else {
return remove_action( 'woocommerce_after_add_to_cart_quantity', array( $apple_pay_instance, 'display_apple_pay_button' ), 1 );
}
}
add_action( 'init', 'remove_stripe_apple_pay_button', 1 );