Add new hook to order-tracking

Add additional hook for order tracking, So developer can add additional field for example adding captcha field.
This commit is contained in:
erikdemarco 2021-07-20 13:37:11 +07:00 committed by Jorge A. Torres
parent 605fc47389
commit be8e0744e5
1 changed files with 5 additions and 1 deletions

View File

@ -21,6 +21,7 @@ global $post;
?>
<form action="<?php echo esc_url( get_permalink( $post->ID ) ); ?>" method="post" class="woocommerce-form woocommerce-form-track-order track_order">
<?php do_action( 'woocommerce_order_tracking_form_start' ); ?>
<p><?php esc_html_e( 'To track your order please enter your Order ID in the box below and press the "Track" button. This was given to you on your receipt and in the confirmation email you should have received.', 'woocommerce' ); ?></p>
@ -28,7 +29,10 @@ global $post;
<p class="form-row form-row-last"><label for="order_email"><?php esc_html_e( 'Billing email', 'woocommerce' ); ?></label> <input class="input-text" type="text" name="order_email" id="order_email" value="<?php echo isset( $_REQUEST['order_email'] ) ? esc_attr( wp_unslash( $_REQUEST['order_email'] ) ) : ''; ?>" placeholder="<?php esc_attr_e( 'Email you used during checkout.', 'woocommerce' ); ?>" /></p><?php // @codingStandardsIgnoreLine ?>
<div class="clear"></div>
<?php do_action( 'woocommerce_order_tracking_form' ); ?>
<p class="form-row"><button type="submit" class="button" name="track" value="<?php esc_attr_e( 'Track', 'woocommerce' ); ?>"><?php esc_html_e( 'Track', 'woocommerce' ); ?></button></p>
<?php wp_nonce_field( 'woocommerce-order_tracking', 'woocommerce-order-tracking-nonce' ); ?>
<?php do_action( 'woocommerce_order_tracking_form_end' ); ?>
</form>