Last active
August 11, 2022 10:59
-
-
Save dougaitken/79922e6a8e0999307dd719f25e98b36a to your computer and use it in GitHub Desktop.
[broken] Moving the WooCommerce Stripe Payment Request buttons below the add to cart button
Thanks for the code.
I find out not to change the code in the plugin - because its bad practice.
add_action('init', 'der_spanier_change_stripe_express_checkout_woo_position_after_buy_button', 11);
function der_spanier_change_stripe_express_checkout_woo_position_after_buy_button()
{
remove_action('woocommerce_after_add_to_cart_quantity', array(WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html'), 1);
remove_action('woocommerce_after_add_to_cart_quantity', array(WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html'), 2);
add_action('woocommerce_after_add_to_cart_button', array(WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html'), 2);
add_action('woocommerce_after_add_to_cart_button', array(WC_Stripe_Payment_Request::instance(),
'display_payment_request_button_separator_html'), 1);
}
Merry christmas
PS: It is a mystery to me why the Stripe plugin dispels this nonsense
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome, thanks mate!