HELP Movie apple pay Button woocommerce

Proxybunker

Well-known member
Jan 3, 2021
2,660
1,841
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

Proxybunker

Well-known member
Jan 3, 2021
2,660
1,841
120
codecanyonscripts.com
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

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu