details.phtml 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /** @var $block \Magento\Framework\View\Element\Template */
  8. $parentBlock = $block->getParentBlock();
  9. $track = $block->getData('track');
  10. $email = $block->getData('storeSupportEmail');
  11. $fields = [
  12. 'Status' => 'getStatus',
  13. 'Signed by' => 'getSignedby',
  14. 'Delivered to' => 'getDeliveryLocation',
  15. 'Shipped or billed on' => 'getShippedDate',
  16. 'Service Type' => 'getService',
  17. 'Weight' => 'getWeight',
  18. ];
  19. $number = is_object($track) ? $track->getTracking() : $track['number'];
  20. ?>
  21. <table class="data table order tracking" id="tracking-table-popup-<?= $block->escapeHtml($number) ?>">
  22. <caption class="table-caption"><?= $block->escapeHtml(__('Order tracking')) ?></caption>
  23. <tbody>
  24. <?php if (is_object($track)): ?>
  25. <tr>
  26. <th class="col label" scope="row"><?= $block->escapeHtml(__('Tracking Number:')) ?></th>
  27. <td class="col value"><?= $block->escapeHtml($number) ?></td>
  28. </tr>
  29. <?php if ($track->getCarrierTitle()): ?>
  30. <tr>
  31. <th class="col label" scope="row"><?= $block->escapeHtml(__('Carrier:')) ?></th>
  32. <td class="col value"><?= $block->escapeHtml($track->getCarrierTitle()) ?></td>
  33. </tr>
  34. <?php endif; ?>
  35. <?php if ($track->getErrorMessage()): ?>
  36. <tr>
  37. <th class="col label" scope="row"><?= $block->escapeHtml(__('Error:')) ?></th>
  38. <td class="col error">
  39. <?= $block->escapeHtml(__('Tracking information is currently not available. Please ')) ?>
  40. <?php if ($parentBlock->getContactUsEnabled()) : ?>
  41. <a href="<?= $block->escapeUrl($parentBlock->getContactUs()) ?>" target="_blank"
  42. title="<?= $block->escapeHtml(__('contact us')) ?>">
  43. <?= $block->escapeHtml(__('contact us')) ?>
  44. </a>
  45. <?= $block->escapeHtml(__(' for more information or ')) ?>
  46. <?php endif; ?>
  47. <?= $block->escapeHtml(__('email us at ')) ?>
  48. <a href="mailto:<?= /* @noEscape */ $email ?>"><?= /* @noEscape */ $email ?></a>
  49. </td>
  50. </tr>
  51. <?php elseif ($track->getTrackSummary()): ?>
  52. <tr>
  53. <th class="col label" scope="row"><?= $block->escapeHtml(__('Info:')) ?></th>
  54. <td class="col value"><?= $block->escapeHtml($track->getTrackSummary()) ?></td>
  55. </tr>
  56. <?php elseif ($track->getUrl()): ?>
  57. <tr>
  58. <th class="col label" scope="row"><?= $block->escapeHtml(__('Track:')) ?></th>
  59. <td class="col value">
  60. <a href="<?= $block->escapeUrl($track->getUrl()) ?>" target="_blank">
  61. <?= $block->escapeUrl($track->getUrl()) ?>
  62. </a>
  63. </td>
  64. </tr>
  65. <?php else: ?>
  66. <?php foreach ($fields as $title => $property): ?>
  67. <?php if (!empty($track->$property())): ?>
  68. <tr>
  69. <th class="col label" scope="row"><?= /* @noEscape */ $block->escapeHtml(__($title . ':')) ?></th>
  70. <td class="col value"><?= $block->escapeHtml($track->$property()) ?></td>
  71. </tr>
  72. <?php endif;?>
  73. <?php endforeach; ?>
  74. <?php if ($track->getDeliverydate()): ?>
  75. <tr>
  76. <th class="col label" scope="row"><?= $block->escapeHtml(__('Delivered on:')) ?></th>
  77. <td class="col value">
  78. <?= /* @noEscape */ $parentBlock->formatDeliveryDateTime($track->getDeliverydate(), $track->getDeliverytime()) ?>
  79. </td>
  80. </tr>
  81. <?php endif; ?>
  82. <?php endif; ?>
  83. <?php elseif (isset($track['title']) && isset($track['number']) && $track['number']): ?>
  84. <?php /* if the tracking is custom value */ ?>
  85. <tr>
  86. <th class="col label" scope="row">
  87. <?= ($track['title'] ? $block->escapeHtml($track['title']) : $block->escapeHtml(__('N/A'))) ?>:
  88. </th>
  89. <td class="col value"><?= (isset($track['number']) ? $block->escapeHtml($track['number']) : '') ?></td>
  90. </tr>
  91. <?php endif; ?>
  92. </tbody>
  93. </table>