Disabling Apple Pay Breaks Shop & Product Pages
-
My client didn’t want Apple Pay showing up on her payment processing pages. When I deactivated it in the Stripe settings the Shop and Product pages break. The site is built with the Divi Builder and a child theme. In order to fix those pages, I had to reactivate Apple Pay. I tried some code I found to add to the functions.php file to remove it from the Checkout page but it broke the site:
<?php
/**
* Remove Apple Pay button on the checkout page
*
* @return bool
*/
function remove_stripe_apple_pay_button_on_checkout() {
$apple_pay_instance = WC_Stripe_Apple_Pay::instance();
remove_action( ‘woocommerce_checkout_before_customer_details’, array( $apple_pay_instance, ‘display_apple_pay_button’ ), 1 );
remove_action( ‘woocommerce_checkout_before_customer_details’, array( $apple_pay_instance, ‘display_apple_pay_separator_html’ ), 2 );
}
add_action( ‘init’, ‘remove_stripe_apple_pay_button_on_checkout’, 1 );The page I need help with: [log in to see the link]
- The topic ‘Disabling Apple Pay Breaks Shop & Product Pages’ is closed to new replies.