Automattic\WooCommerce\Internal\Fulfillments
FulfillmentsRenderer::render_fulfillment_customer_details
Render the fulfillment customer details in the order details page.
Method of the class: FulfillmentsRenderer{}
No Hooks.
Returns
null. Nothing (null).
Usage
$FulfillmentsRenderer = new FulfillmentsRenderer(); $FulfillmentsRenderer->render_fulfillment_customer_details( $order );
- $order(WC_Order) (required)
- The order object.
FulfillmentsRenderer::render_fulfillment_customer_details() FulfillmentsRenderer::render fulfillment customer details code WC 10.3.3
<?php
public function render_fulfillment_customer_details( WC_Order $order ) {
$fulfillments = $this->maybe_read_fulfillments( $order );
if ( ! empty( $fulfillments ) ) {
?>
<section class="woocommerce-order-details">
<table class="woocommerce-table woocommerce-table--order-details shop_table order_details">
<thead>
<?php
foreach ( $fulfillments as $index => $fulfillment ) {
if ( ! $fulfillment->get_is_fulfilled() ) {
continue;
}
?>
<tr>
<th class="woocommerce-table__shipment-info shipment-info" style="font-weight: normal;">
<?php
printf(
/* translators: %1$s is the shipment index, %2$s is the shipment date */
wp_kses( __( '<b>Shipment %1$s</b> was shipped on <b>%2$s</b>', 'woocommerce' ), 'b' ),
intval( $index ) + 1,
esc_html(
gmdate(
'F j, Y',
strtotime(
$fulfillment->get_date_fulfilled() // Get the fulfilled date.
?? $fulfillment->get_date_updated() // Fallback to the updated date if fulfilled date is not set.
)
)
)
);
?>
</th>
<th class="woocommerce-table__shipment-tracking shipment-tracking" style="font-weight: normal;">
<?php echo wp_kses( FulfillmentUtils::get_tracking_info_html( $fulfillment ), 'a' ); ?>
</th>
</tr>
<?php
}
?>
</thead>
</table>
</section>
<?php
}
}