• Resolved Caleb OLoan

    (@caleb-oloan)


    Hi,

    I’m trying to move the Apple Pay button from top of checkout to near where the other options are. I have looked through the documentation and found this below but it breaks my site now.
    Do you know what the latest version should be?
    Thanks a lot

    /*
    * Removes Apple Pay button on the checkout page.
    */
    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_checkout_after_customer_details’, array( WC_Stripe_Payment_Request::instance(), ‘display_payment_request_button_separator_html’ ), 1 );
    add_action( ‘woocommerce_checkout_after_customer_details’, array( WC_Stripe_Payment_Request::instance(), ‘display_payment_request_button_html’ ), 2 );

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hey @caleb-oloan

    I’ve been fighting with this for a day or so now but had a lightbulb moment.

    but it breaks my site now.

    I copy and pasted your code, and indeed, it broke my site as well.

    Then I finally looked at it in a code editor against a snippet I’ve used before to move the Payment Request button on the product page.

    The reason it’s not working? The character. Your code has
    ‘woocommerce_checkout_before_customer_details’
    The correct version is
    'woocommerce_checkout_before_customer_details'

    Your code has an apostrophe and the correct code has a “grave accent”.

    Copy this gist and it will work – https://gist.github.com/dougaitken/4a2e9469dee1ed2a6e67ab3fbb947b3b

    Thread Starter Caleb OLoan

    (@caleb-oloan)

    Thank you very much, that’s great!

    • This reply was modified 5 years, 5 months ago by Caleb OLoan.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Move Buy With Apple Pay Button’ is closed to new replies.