<?php
/**
 * Maho
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2022 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<span class="field-row grid" id="shipment_tracking_info">

<?php if($this->trackingInfo): ?>
    <strong><?= $this->escapeHtml($this->trackingInfo->getCarrierTitle()) ?></strong> - <?= $this->trackingInfo->getTracking() ?>
    <div class="info">
        <?php if ($this->trackingInfo->getErrorMessage()): ?>
            <?= $this->escapeHtml($this->trackingInfo->getErrorMessage()) ?>
        <?php else: ?>
            <?php if ($this->trackingInfo->getUrl()): ?>
                Please, visit for more info: <a href="<?= $this->trackingInfo->getUrl() ?>" target="_blank"><?= $this->escapeHtml($this->trackingInfo->getCarrierTitle()) ?></a><br />
            <?php endif ?>

            <?php if ($this->trackingInfo->getStatus()): ?>
                Status: <?= $this->trackingInfo->getStatus() ?><br />
            <?php endif ?>

            <?php if ($this->trackingInfo->getDeliverydate()): ?>
                Delivery Date: <?= $this->trackingInfo->getDeliverydate() ?><br />
            <?php endif ?>

            <?php if ($this->trackingInfo->getDeliverytime()): ?>
                Delivery Time: <?= $this->trackingInfo->getDeliverytime() ?><br />
            <?php endif ?>

            <?php if ($this->trackingInfo->getDeliverylocation()): ?>
                Delivery Location: <?= $this->trackingInfo->getDeliverylocation() ?><br />
            <?php endif ?>

            <?php if ($this->trackingInfo->getSignedby()): ?>
                Signed by: <?= $this->trackingInfo->getSignedby() ?><br />
            <?php endif ?>

            <?php if ($this->trackingInfo->getTrackSummary()): ?>
                Tracking summary: <?= $this->trackingInfo->getTrackSummary() ?><br />
            <?php endif ?>

        <?php endif ?>
    </div>
<?php endif ?>

</span>
