Amending the Position of the Google Pay and Apple Pay Buttons in WooCommerce

How to move the Google Pay and Apple Pay buttons in your WooCommerce store.

This article is for me really, as a reminder of how to do this job when the plugin updates and wipes out my changes :-D

To change the default position of the Google Pay and Apple Pay buttons on your WooCommerce site, you need to modify the code in the plugin that generates it. I am using Square, so will amend the Square plugin.

I navigated to the Gateway folder, and found the Digital_Wallet.php file. On lines 83-93 are the lines to add the buttons to the WordPress hooks. I amended the final one from

add_action( 'woocommerce_before_checkout_form', array( $this, 'render_button' ), 15 );

to


add_action( 'woocommerce_review_order_before_payment', array( $this, 'render_button' ), 15 );

I also amended a small amount of CSS to make it look a bit better, and make the 'OR' part stand out a bit more as it was causing confusion.

I hope this helps somebody in future!

Let’s talk about your project

We help companies and individuals build out their brand guidelines.

By submitting this form, I agree to the privacy policy.

“Steven has gone over and above to deliver the most amazing website for me and I am absolutely thrilled with it. His patience through my numerous changes and his vision in getting it just right has been fantastic. I would highly recommend him to anyone looking for a new website and have already done so to colleagues and friends. Thank you Steven for everything!”

Eliza Maftin
Maidens & Ravens