Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thisissandip/88a09a7a198166c5938b4504aaebdc9b to your computer and use it in GitHub Desktop.
Save thisissandip/88a09a7a198166c5938b4504aaebdc9b to your computer and use it in GitHub Desktop.
Move Payment Request Buttons button - WC Stripe
/**
* Move Payment Request Buttons button - Stripe
*/
function move_woocommerce_stripe_payment_request_buttons() {
$PaymentReqBtnInst = WC_Stripe_Payment_Request::instance();
//Checkout Page
remove_action( 'woocommerce_checkout_before_customer_details', array( $PaymentReqBtnInst, 'display_payment_request_button_separator_html' ), 2 );
remove_action( 'woocommerce_checkout_before_customer_details', array( $PaymentReqBtnInst, 'display_payment_request_button_html' ), 1 );
// Move to any location
add_action( 'woocommerce_review_order_before_payment', array( $PaymentReqBtnInst, 'display_payment_request_button_html' ), 1 );
add_action( 'woocommerce_review_order_before_payment', array( $PaymentReqBtnInst, 'display_payment_request_button_separator_html' ), 2 );
}
add_action( 'init', 'move_woocommerce_stripe_payment_request_buttons', 1 );
@hassanayoub1985
Copy link

Hello,
I changed woocommerce_review_order_before_payment with woocommerce_review_order_after_payment to put it under the stripe credit card option, however, it appeared under the agree checkbox. Any idea how to put it strictly under COD and Stripe options?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment