Ensure a valid order is found in order-details.php template
Closes #16049
This commit is contained in:
parent
5c32abfe6b
commit
fb784930f6
|
@ -20,10 +20,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$order = wc_get_order( $order_id );
|
||||
$order_items = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
|
||||
$show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) );
|
||||
$show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
|
||||
if ( ! $order = wc_get_order( $order_id ) ) {
|
||||
return;
|
||||
}
|
||||
$order_items = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
|
||||
$show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) );
|
||||
$show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
|
||||
?>
|
||||
|
||||
<section class="woocommerce-order-details">
|
||||
|
|
Loading…
Reference in New Issue