woocommerce_order_details_table()
Displays order details in a table.
Хуки из функции
Возвращает
null. Ничего (null).
Использование
woocommerce_order_details_table( $order_id );
- $order_id(разное) (обязательный)
- Order ID.
Код woocommerce_order_details_table() woocommerce order details table WC 10.5.2
function woocommerce_order_details_table( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
if ( ! $order ) {
return;
}
$template = 'order/order-details.php';
if ( FeaturesUtil::feature_is_enabled( 'fulfillments' ) ) {
$fulfillment_data_store = wc_get_container()->get( FulfillmentsDataStore::class );
$fulfillments = $fulfillment_data_store->read_fulfillments( WC_Order::class, $order_id );
if ( ! empty( $fulfillments ) ) {
$template = 'order/order-details-fulfillments.php';
}
}
wc_get_template(
$template,
array(
'order_id' => $order_id,
/**
* Determines if the order downloads table should be shown (in the context of the order details
* template).
*
* By default, this is true if the order has at least one dowloadable items and download is permitted
* (which is partly determined by the order status). For special cases, though, this can be overridden
* and the downloads table can be forced to render (or forced not to render).
*
* @since 8.5.0
*
* @param bool $show_downloads If the downloads table should be shown.
* @param WC_Order $order The related order.
*/
'show_downloads' => apply_filters( 'woocommerce_order_downloads_table_show_downloads', ( $order->has_downloadable_item() && $order->is_download_permitted() ), $order ),
)
);
}