before_woocommerce_pay_form
Triggered right before the Pay for Order form, after validation of the order and customer.
Usage
add_action( 'before_woocommerce_pay_form', 'wp_kama_before_woocommerce_pay_form_action', 10, 3 ); /** * Function for `before_woocommerce_pay_form` action-hook. * * @param WC_Order $order The order that is being paid for. * @param string $order_button_text The text for the submit button. * @param array $available_gateways All available gateways. * * @return void */ function wp_kama_before_woocommerce_pay_form_action( $order, $order_button_text, $available_gateways ){ // action... }
- $order(WC_Order)
- The order that is being paid for.
- $order_button_text(string)
- The text for the submit button.
- $available_gateways(array)
- All available gateways.
Changelog
Since 6.6 | Introduced. |
Where the hook is called
before_woocommerce_pay_form
woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php 221
do_action( 'before_woocommerce_pay_form', $order, $order_button_text, $available_gateways );