grid.phtml 5.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /** @var \Magento\Customer\Block\Address\Grid $block */
  8. $customerAddressView = $block->getData('customer_address');
  9. ?>
  10. <div class="block block-addresses-list">
  11. <div class="block-title"><strong><?= $block->escapeHtml(__('Additional Address Entries')) ?></strong></div>
  12. <div class="block-content">
  13. <?php if ($_pAddsses = $block->getAdditionalAddresses()): ?>
  14. <div class="table-wrapper additional-addresses">
  15. <table class="data table table-additional-addresses-items history" id="additional-addresses-table">
  16. <caption class="table-caption"><?= /* @escapeNotVerified */ __('Additional addresses') ?></caption>
  17. <thead>
  18. <tr>
  19. <th scope="col" class="col firstname"><?= /* @escapeNotVerified */ __('First Name') ?></th>
  20. <th scope="col" class="col lastname"><?= /* @escapeNotVerified */ __('Last Name') ?></th>
  21. <th scope="col" class="col streetaddress"><?= /* @escapeNotVerified */ __('Street Address') ?></th>
  22. <th scope="col" class="col city"><?= /* @escapeNotVerified */ __('City') ?></th>
  23. <th scope="col" class="col country"><?= /* @escapeNotVerified */ __('Country') ?></th>
  24. <th scope="col" class="col state"><?= /* @escapeNotVerified */ __('State') ?></th>
  25. <th scope="col" class="col zip"><?= /* @escapeNotVerified */ __('Zip/Postal Code') ?></th>
  26. <th scope="col" class="col phone"><?= /* @escapeNotVerified */ __('Phone') ?></th>
  27. <th scope="col" class="col actions"> </th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. <?php foreach ($_pAddsses as $address): ?>
  32. <tr>
  33. <td data-th="<?= $block->escapeHtml(__('First Name')) ?>" class="col firstname"><?= $block->escapeHtml($address->getFirstname()) ?></td>
  34. <td data-th="<?= $block->escapeHtml(__('Last Name')) ?>" class="col lastname"><?= $block->escapeHtml($address->getLastname()) ?></td>
  35. <td data-th="<?= $block->escapeHtml(__('Street Address')) ?>" class="col streetaddress"><?= $block->escapeHtml($block->getStreetAddress($address)) ?></td>
  36. <td data-th="<?= $block->escapeHtml(__('City')) ?>" class="col city"><?= $block->escapeHtml($address->getCity()) ?></td>
  37. <td data-th="<?= $block->escapeHtml(__('Country')) ?>" class="col country"><?= /* @escapeNotVerified */ $block->getCountryByCode($address->getCountryId()) ?></td>
  38. <td data-th="<?= $block->escapeHtml(__('State')) ?>" class="col state"><?= /* @escapeNotVerified */ $address->getRegion()->getRegion() ?></td>
  39. <td data-th="<?= $block->escapeHtml(__('Zip/Postal Code')) ?>" class="col zip"><?= $block->escapeHtml($address->getPostcode()) ?></td>
  40. <td data-th="<?= $block->escapeHtml(__('Phone')) ?>" class="col phone"><?= $block->escapeHtml($address->getTelephone()) ?></td>
  41. <td data-th="<?= $block->escapeHtml(__('Actions')) ?>" class="col actions">
  42. <a class="action edit" href="<?= $block->escapeUrl($block->getUrl('customer/address/edit', ['id' => $address->getId()])) ?>"><span><?= $block->escapeHtml(__('Edit')) ?></span></a>
  43. <a class="action delete" href="#" role="delete-address" data-address="<?= $block->escapeHtmlAttr($address->getId()) ?>"><span><?= $block->escapeHtml(__('Delete')) ?></span></a>
  44. </td>
  45. </tr>
  46. <?php endforeach; ?>
  47. </tbody>
  48. </table>
  49. </div>
  50. <?php if ($block->getChildHtml('pager')): ?>
  51. <div class="customer-addresses-toolbar toolbar bottom"><?= $block->getChildHtml('pager') ?></div>
  52. <?php endif ?>
  53. <?php else: ?>
  54. <p class="empty"><?= $block->escapeHtml(__('You have no other address entries in your address book.')) ?></p>
  55. <?php endif ?>
  56. </div>
  57. </div>
  58. <div class="actions-toolbar">
  59. <div class="primary">
  60. <button type="button" role="add-address" title="<?= $block->escapeHtmlAttr(__('Add New Address')) ?>" class="action primary add"><span><?= $block->escapeHtml(__('Add New Address')) ?></span></button>
  61. </div>
  62. <div class="secondary">
  63. <a class="action back" href="<?= $block->escapeUrl($block->getBackUrl()) ?>"><span><?= $block->escapeHtml(__('Back')) ?></span></a>
  64. </div>
  65. </div>
  66. <script type="text/x-magento-init">
  67. {
  68. ".page-main": {
  69. "address": {
  70. "deleteAddress": "td a[role='delete-address']",
  71. "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
  72. "addAddress": "button[role='add-address']",
  73. "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"
  74. }
  75. }
  76. }
  77. </script>