items.phtml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /** @var \Magento\Sales\Block\Order\Items $block */
  8. ?>
  9. <div class="table-wrapper order-items">
  10. <table class="data table table-order-items" id="my-orders-table" summary="<?= /* @escapeNotVerified */ __('Items Ordered') ?>">
  11. <caption class="table-caption"><?= /* @escapeNotVerified */ __('Items Ordered') ?></caption>
  12. <thead>
  13. <?php if($block->isPagerDisplayed()): ?>
  14. <tr>
  15. <td colspan="5" data-block="order-items-pager-top" class="order-pager-wrapper order-pager-wrapper-top">
  16. <?= $block->getPagerHtml() ?>
  17. </td>
  18. </tr>
  19. <?php endif ?>
  20. <tr>
  21. <th class="col name"><?= /* @escapeNotVerified */ __('Product Name') ?></th>
  22. <th class="col sku"><?= /* @escapeNotVerified */ __('SKU') ?></th>
  23. <th class="col price"><?= /* @escapeNotVerified */ __('Price') ?></th>
  24. <th class="col qty"><?= /* @escapeNotVerified */ __('Qty') ?></th>
  25. <th class="col subtotal"><?= /* @escapeNotVerified */ __('Subtotal') ?></th>
  26. </tr>
  27. </thead>
  28. <?php $items = $block->getItems(); ?>
  29. <?php $giftMessage = ''?>
  30. <tbody>
  31. <?php foreach ($items as $item): ?>
  32. <?php if ($item->getParentItem()) continue; ?>
  33. <?= $block->getItemHtml($item) ?>
  34. <?php if ($this->helper('Magento\GiftMessage\Helper\Message')->isMessagesAllowed('order_item', $item) && $item->getGiftMessageId()): ?>
  35. <?php $giftMessage = $this->helper('Magento\GiftMessage\Helper\Message')->getGiftMessageForEntity($item); ?>
  36. <tr>
  37. <td class="col options" colspan="5">
  38. <a href="#"
  39. id="order-item-gift-message-link-<?= /* @escapeNotVerified */ $item->getId() ?>"
  40. class="action show"
  41. aria-controls="order-item-gift-message-<?= /* @escapeNotVerified */ $item->getId() ?>"
  42. data-item-id="<?= /* @escapeNotVerified */ $item->getId() ?>">
  43. <?= /* @escapeNotVerified */ __('Gift Message') ?>
  44. </a>
  45. <?php $giftMessage = $this->helper('Magento\GiftMessage\Helper\Message')->getGiftMessageForEntity($item); ?>
  46. <div class="order-gift-message" id="order-item-gift-message-<?= /* @escapeNotVerified */ $item->getId() ?>" role="region" aria-expanded="false" tabindex="-1">
  47. <a href="#"
  48. title="<?= /* @escapeNotVerified */ __('Close') ?>"
  49. aria-controls="order-item-gift-message-<?= /* @escapeNotVerified */ $item->getId() ?>"
  50. data-item-id="<?= /* @escapeNotVerified */ $item->getId() ?>"
  51. class="action close">
  52. <?= /* @escapeNotVerified */ __('Close') ?>
  53. </a>
  54. <dl class="item-options">
  55. <dt class="item-sender"><strong class="label"><?= /* @escapeNotVerified */ __('From') ?></strong><?= $block->escapeHtml($giftMessage->getSender()) ?></dt>
  56. <dt class="item-recipient"><strong class="label"><?= /* @escapeNotVerified */ __('To') ?></strong><?= $block->escapeHtml($giftMessage->getRecipient()) ?></dt>
  57. <dd class="item-message"><?= /* @escapeNotVerified */ $this->helper('Magento\GiftMessage\Helper\Message')->getEscapedGiftMessage($item) ?></dd>
  58. </dl>
  59. </div>
  60. </td>
  61. </tr>
  62. <?php endif ?>
  63. <?php endforeach; ?>
  64. </tbody>
  65. <tfoot>
  66. <?php if($block->isPagerDisplayed()): ?>
  67. <tr>
  68. <td colspan="5" data-block="order-items-pager-bottom" class="order-pager-wrapper order-pager-wrapper-bottom">
  69. <?= $block->getPagerHtml() ?>
  70. </td>
  71. </tr>
  72. <?php endif ?>
  73. <?= $block->getChildHtml('order_totals') ?>
  74. </tfoot>
  75. </table>
  76. </div>
  77. <?php if ($giftMessage): ?>
  78. <script type="text/x-magento-init">
  79. {
  80. "a.action.show, a.action.close": {
  81. "giftMessage": {}
  82. }
  83. }
  84. </script>
  85. <?php endif; ?>