-
-
Save dougaitken/79922e6a8e0999307dd719f25e98b36a to your computer and use it in GitHub Desktop.
Just updated the Stripe plugin to 4.5.2 and had the same issue again. Had to again replace the
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 );
Is it not possible to accomodate the display of payment button after the add to cart button somehow so that with the next update of the plugin we do not have to manually adjust it? Thanks.
awesome, thanks mate!
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
Hi Doug, how can we wrap this is a function_exists check to see if stripe is active? because if you disable woo-commerce while troubleshooting it throws a Uncaught Error: Class 'WC_Stripe_Payment_Request' not found