before_woocommerce_pay_form action-hookWC 6.6

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

WC_Shortcode_Checkout::order_pay()
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 );

Where the hook is used in WooCommerce

Usage not found.