• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

HELP Movie apple pay Button woocommerce

Proxybunker

Well-known member
Trusted Uploader
Jan 3, 2021
3,073
2,326
120
codecanyonscripts.com
Hi im looking to see if anyone can help I want to move the apple pay button from the top of the checkout to the bottom see image
in the second image is the two places that I want to move the button to

this is the code I have tried but has not worked

any help will be much appreciated


PHP:
/*
 * Removes Apple Pay button on the checkout page.
 */
remove_action( 'woocommerce_checkout_before_customer_details', array( WC_Stripe_Apple_Pay::instance(), 'display_apple_pay_button' ), 1 );
remove_action( 'woocommerce_checkout_before_customer_details', array( WC_Stripe_Apple_Pay::instance(), 'display_apple_pay_separator_html' ), 2 );

/*
 * Adds Apple Pay button on the checkout page, below customers details, and inverse button/separator order.
 */
add_action( 'woocommerce_checkout_after_customer_details', array( WC_Stripe_Apple_Pay::instance(), 'display_apple_pay_separator_html' ), 1 );
add_action( 'woocommerce_checkout_after_customer_details', array( WC_Stripe_Apple_Pay::instance(), 'display_apple_pay_button' ), 2 );


IMG_0030.PNG


IMG_0031.PNG
 

Attachments

  • IMG_0030.PNG
    IMG_0030.PNG
    484.3 KB · Views: 1
I managed to work out the code that was needed


PHP:
/*
* Adds then moves Apple Pay button on the checkout page.
*/

add_filter( 'wc_stripe_show_payment_request_on_checkout', '__return_true' );

remove_action( 'woocommerce_checkout_before_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html' ), 1 );
remove_action( 'woocommerce_checkout_before_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html' ), 2 );
/*
 * Adds Apple Pay button on the checkout page, below customers details, and inverse button/separator order.
 */
add_action( 'woocommerce_review_order_after_submit', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html' ), 2 );
add_action( 'woocommerce_review_order_after_submit', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html' ), 1 );

IMG_0248.PNG
 
Last edited:
  • Like
Reactions: xsz and nevenx
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock