diff --git a/includes/shortcodes/class-wc-shortcode-order-tracking.php b/includes/shortcodes/class-wc-shortcode-order-tracking.php index 1bc9fa9bd74..0ceffb5a24b 100644 --- a/includes/shortcodes/class-wc-shortcode-order-tracking.php +++ b/includes/shortcodes/class-wc-shortcode-order-tracking.php @@ -4,10 +4,10 @@ * * Lets a user see the status of an order by entering their order details. * - * @author WooThemes - * @category Shortcodes - * @package WooCommerce/Shortcodes/Order_Tracking - * @version 2.3.0 + * @author WooThemes + * @category Shortcodes + * @package WooCommerce/Shortcodes/Order_Tracking + * @version 2.7.0 */ class WC_Shortcode_Order_Tracking { @@ -39,23 +39,17 @@ class WC_Shortcode_Order_Tracking { if ( ! empty( $_REQUEST['orderid'] ) && isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'woocommerce-order_tracking' ) ) { - $order_id = empty( $_REQUEST['orderid'] ) ? 0 : esc_attr( $_REQUEST['orderid'] ); - $order_email = empty( $_REQUEST['order_email'] ) ? '' : esc_attr( $_REQUEST['order_email'] ); + $order_id = empty( $_REQUEST['orderid'] ) ? 0 : esc_attr( $_REQUEST['orderid'] ); + $order_email = empty( $_REQUEST['order_email'] ) ? '' : esc_attr( $_REQUEST['order_email'] ); if ( ! $order_id ) { - - echo '

' . __( 'Please enter a valid order ID', 'woocommerce' ) . '

'; - + wc_add_notice( __( 'Please enter a valid order ID', 'woocommerce' ), 'error' ); } elseif ( ! $order_email ) { - - echo '

' . __( 'Please enter a valid order email', 'woocommerce' ) . '

'; - + wc_add_notice( __( 'Please enter a valid order email', 'woocommerce' ), 'error' ); } else { - $order = wc_get_order( apply_filters( 'woocommerce_shortcode_order_tracking_order_id', $order_id ) ); if ( $order && $order->get_id() && $order_email ) { - if ( strtolower( $order->get_billing_email() ) == strtolower( $order_email ) ) { do_action( 'woocommerce_track_order', $order->get_id() ); wc_get_template( 'order/tracking.php', array( @@ -65,13 +59,13 @@ class WC_Shortcode_Order_Tracking { return; } } else { - - echo '

' . __( 'Sorry, we could not find that order ID in our database.', 'woocommerce' ) . '

'; - + wc_add_notice( __( 'Sorry, we could not find that order ID in our database.', 'woocommerce' ), 'error' ); } } } + wc_print_notices(); + wc_get_template( 'order/form-tracking.php' ); } }