<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php /* @var $block \Magento\Sales\Block\Order\PrintOrder\Shipment */ ?>
<?php $order = $block->getOrder(); ?>
<?php if (!$block->getObjectData($order, 'is_virtual')) : ?>
    <?php foreach ($block->getShipmentsCollection() as $shipment) : ?>
        <div class="order-details-items shipments">
            <div class="order-title">
                <strong><?= $block->escapeHtml(__('Shipment #%1', $block->getObjectData($shipment, 'increment_id'))) ?></strong>
            </div>
            <div class="table-wrapper order-items-shipment">
                <table class="data table table-order-items shipment" id="my-shipment-table-<?= (int) $block->getObjectData($shipment, 'id') ?>">
                    <caption class="table-caption"><?= $block->escapeHtml(__('Items Invoiced')) ?></caption>
                    <thead>
                    <tr>
                        <th class="col name"><?= $block->escapeHtml(__('Product Name')) ?></th>
                        <th class="col sku"><?= $block->escapeHtml(__('SKU')) ?></th>
                        <th class="col price"><?= $block->escapeHtml(__('Qty Shipped')) ?></th>
                    </tr>
                    </thead>
                    <?php foreach ($block->getShipmentItems($shipment) as $item) : ?>
                        <tbody>
                            <?= $block->getItemHtml($item) ?>
                        </tbody>
                    <?php endforeach; ?>
                </table>
            </div>
            <div class="block block-order-details-view">
                <div class="block-title">
                    <strong><?= $block->escapeHtml(__('Order Information')) ?></strong>
                </div>
                <div class="block-content">
                    <div class="box box-order-shipping-address">
                        <div class="box-title">
                            <strong><?= $block->escapeHtml(__('Shipping Address')) ?></strong>
                        </div>
                        <div class="box-content">
                            <address><?= $block->getShipmentAddressFormattedHtml($shipment) ?></address>
                        </div>
                    </div>

                    <div class="box box-order-shipping-method">
                        <div class="box-title">
                            <strong><?= $block->escapeHtml(__('Shipping Method')) ?></strong>
                        </div>
                        <div class="box-content">
                        <?= $block->escapeHtml($block->getObjectData($order, 'shipping_description')) ?>
                        <?php $tracks = $block->getShipmentTracks($shipment);
                        if ($tracks) : ?>
                            <dl class="order-tracking">
                            <?php foreach ($tracks as $track) : ?>
                                <dt class="tracking-title"><?= $block->escapeHtml($block->getObjectData($track, 'title')) ?></dt>
                                <dd class="tracking-content"><?= $block->escapeHtml($block->getObjectData($track, 'number')) ?></dd>
                            <?php endforeach; ?>
                            </dl>
                        <?php endif; ?>
                        </div>
                    </div>

                    <div class="box box-order-billing-method">
                        <div class="box-title">
                            <strong><?= $block->escapeHtml(__('Billing Address')) ?></strong>
                        </div>
                        <div class="box-content">
                            <address><?= $block->getBillingAddressFormattedHtml($order) ?></address>
                        </div>
                    </div>

                    <div class="box box-order-billing-method">
                        <div class="box-title">
                            <strong><?= $block->escapeHtml(__('Payment Method')) ?></strong>
                        </div>
                        <div class="box-content">
                            <?= $block->getPaymentInfoHtml() ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    <?php endforeach; ?>
<?php endif; ?>
