Last active
December 20, 2021 21:25
-
-
Save dougaitken/4a2e9469dee1ed2a6e67ab3fbb947b3b to your computer and use it in GitHub Desktop.
Adds the Payment Request button (Apple Pay) on the checkout page then moves it to after the customer details (WooCommerce Stripe extension)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adds the Payment Request button (Apple Pay) on the checkout page then moves it to after the customer details. | |
// Replace `woocommerce_checkout_after_customer_details` with wherever you want to | |
add_filter( 'wc_stripe_show_payment_request_on_checkout', '__return_true' ); | |
remove_action( 'woocommerce_checkout_before_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html' ), 1 ); | |
remove_action( 'woocommerce_checkout_before_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html' ), 2 ); | |
add_action( 'woocommerce_checkout_after_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html' ), 1 ); | |
add_action( 'woocommerce_checkout_after_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html' ), 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment