Forked from dougaitken/add_move_payment_request_checkout_page.php
Created
December 20, 2021 21:25
-
-
Save espiat/a1f83401e41427ed94af45e520b4902c 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