Skip to content

Instantly share code, notes, and snippets.

@dougaitken
Last active December 20, 2021 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dougaitken/4a2e9469dee1ed2a6e67ab3fbb947b3b to your computer and use it in GitHub Desktop.
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)
// 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