From 3cb59ebc8f5932785f4af100704888953ba8c31e Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Tue, 17 May 2022 20:24:24 +0300 Subject: [PATCH] Adding the action to the Pay for Order shortcode --- .../includes/shortcodes/class-wc-shortcode-checkout.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php b/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php index 4f6450e63d6..e4a6e50b34c 100644 --- a/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php +++ b/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php @@ -183,6 +183,14 @@ class WC_Shortcode_Checkout { current( $available_gateways )->set_current(); } + /** + * Triggered right before the Pay for Order form, after validation of the order and customer. + * + * @param WC_Order $order The order that is being paid for. + * @param string $order_button_text The text for the submit button. + */ + do_action( 'before_woocommerce_pay_form', $order, $order_button_text ); + wc_get_template( 'checkout/form-pay.php', array(