Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Woocommerce checkout payment method hook

Tags:

woocommerce

How to change the hook of the payment method in checkout page?

I found an actions that return order review form with payment method, but how to divide them? One action order review and one payment method

do_action( 'woocommerce_checkout_order_review' );

enter image description here


1 Answers

Two different actions are hooked into 'woocommerce_checkout_order_review'. Those are 'woocommerce_order_review' for order review and 'woocommerce_checkout_payment' for payment method. This is defined in "includes/wc-template-hooks.php"

add_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );
add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );

Action hook 'woocommerce_order_review', calls template page "checkout/review-order.php". Action hook 'woocommerce_checkout_payment', calls template page "checkout/payment.php" Above two action/hook functions are defined in "includes/wc-template-functions.php"

Hope this helps.

like image 96
zipkundan Avatar answered Oct 25 '25 16:10

zipkundan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!