You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

87 lines
4.2 KiB

  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. //phpcs:disable Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace
  7. //phpcs:disable Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore
  8. //phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
  9. //phpcs:disable Magento2.Files.LineLength.MaxExceeded
  10. ?>
  11. <?php /** @var $block \Magento\Shipping\Block\Items */ ?>
  12. <?php $_order = $block->getOrder() ?>
  13. <div class="actions-toolbar">
  14. <?php if ($_order->getTracksCollection()->count()) : ?>
  15. <?= $block->getChildHtml('track-all-link') ?>
  16. <?php endif; ?>
  17. <a href="<?= $block->escapeUrl($block->getPrintAllShipmentsUrl($_order)) ?>"
  18. class="action print"
  19. target="_blank"
  20. rel="noopener">
  21. <span><?= $block->escapeHtml(__('Print All Shipments')) ?></span>
  22. </a>
  23. </div>
  24. <?php foreach ($_order->getShipmentsCollection() as $_shipment) : ?>
  25. <div class="order-title">
  26. <strong><?= $block->escapeHtml(__('Shipment #')) ?><?= $block->escapeHtml($_shipment->getIncrementId()) ?></strong>
  27. <a href="<?= $block->escapeUrl($block->getPrintShipmentUrl($_shipment)) ?>"
  28. class="action print"
  29. target="_blank"
  30. rel="noopener">
  31. <span><?= $block->escapeHtml(__('Print Shipment')) ?></span>
  32. </a>
  33. <a href="#"
  34. data-mage-init='{"popupWindow": {"windowURL":"<?= $block->escapeUrl($this->helper(Magento\Shipping\Helper\Data::class)->getTrackingPopupUrlBySalesModel($_shipment)) ?>","windowName":"trackshipment","width":800,"height":600,"top":0,"left":0,"resizable":1,"scrollbars":1}}'
  35. title="<?= $block->escapeHtml(__('Track this shipment')) ?>"
  36. class="action track">
  37. <span><?= $block->escapeHtml(__('Track this shipment')) ?></span>
  38. </a>
  39. </div>
  40. <?php $tracks = $_shipment->getTracksCollection(); ?>
  41. <?php if ($tracks->count()) : ?>
  42. <dl class="order-tracking" id="my-tracking-table-<?= (int) $_shipment->getId() ?>">
  43. <dt class="tracking-title">
  44. <?= $block->escapeHtml(__('Tracking Number(s):')) ?>
  45. </dt>
  46. <dd class="tracking-content">
  47. <?php
  48. $i = 1;
  49. $_size = $tracks->count();
  50. foreach ($tracks as $track) : ?>
  51. <?php if ($track->isCustom()) : ?>
  52. <?= $block->escapeHtml($track->getNumber()) ?>
  53. <?php else : ?>
  54. <a href="#"
  55. data-mage-init='{"popupWindow": {"windowURL":"<?= $block->escapeUrl($this->helper(Magento\Shipping\Helper\Data::class)->getTrackingPopupUrlBySalesModel($track)) ?>","windowName":"trackorder","width":800,"height":600,"left":0,"top":0,"resizable":1,"scrollbars":1}}'
  56. class="action track"><span><?= $block->escapeHtml($track->getNumber()) ?></span>
  57. </a>
  58. <?php endif; ?>
  59. <?php if ($i != $_size) : ?>, <?php endif; ?>
  60. <?php $i++;
  61. endforeach; ?>
  62. </dd>
  63. </dl>
  64. <?php endif; ?>
  65. <div class="table-wrapper order-items-shipment">
  66. <table class="data table table-order-items shipment" id="my-shipment-table-<?= (int) $_shipment->getId() ?>">
  67. <caption class="table-caption"><?= $block->escapeHtml(__('Items Shipped')) ?></caption>
  68. <thead>
  69. <tr>
  70. <th class="col name"><?= $block->escapeHtml(__('Product Name')) ?></th>
  71. <th class="col sku"><?= $block->escapeHtml(__('SKU')) ?></th>
  72. <th class="col qty"><?= $block->escapeHtml(__('Qty Shipped')) ?></th>
  73. </tr>
  74. </thead>
  75. <?php $_items = $_shipment->getAllItems(); ?>
  76. <?php foreach ($_items as $_item) : ?>
  77. <?php if (!$_item->getOrderItem()->getParentItem()) : ?>
  78. <tbody>
  79. <?= $block->getItemHtml($_item) ?>
  80. </tbody>
  81. <?php endif; ?>
  82. <?php endforeach; ?>
  83. </table>
  84. </div>
  85. <?= $block->getCommentsHtml($_shipment) ?>
  86. <?php endforeach; ?>