-
-
Save espiat/1e70ed6a45691af6a9c36067c769736e to your computer and use it in GitHub Desktop.
Moving the WooCommerce Stripe Payment Request buttons below the add to cart button
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi Figured it out with your above code. Sharing so other could also use it until a solution is rolled out for this known issue here -
woocommerce/woocommerce-gateway-stripe#832
The fix is to go to file
woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php
and replace code
if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'display_payment_request_button_html' ), 1 );
add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'display_payment_request_button_separator_html' ), 2 );
} else {
add_action( 'woocommerce_after_add_to_cart_quantity', array( $this, 'display_payment_request_button_html' ), 1 );
add_action( 'woocommerce_after_add_to_cart_quantity', array( $this, 'display_payment_request_button_separator_html' ), 2 );
}
with
add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'display_payment_request_button_html' ), 2 );
add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'display_payment_request_button_separator_html' ), 1 );
hope this helps.