before_woocommerce_pay_form хук-событиеWC 6.6

Triggered right before the Pay for Order form, after validation of the order and customer.

Использование

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(строка)
The text for the submit button.
$available_gateways(массив)
All available gateways.

Список изменений

С версии 6.6 Введена.

Где вызывается хук

WC_Shortcode_Checkout::order_pay()
before_woocommerce_pay_form
woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php 204
do_action( 'before_woocommerce_pay_form', $order, $order_button_text, $available_gateways );

Где используется хук в WooCommerce

Использование не найдено.