view.phtml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /** @var \Magento\Wishlist\Block\Customer\Wishlist $block */
  8. ?>
  9. <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?>
  10. <div class="toolbar wishlist-toolbar"><?= $block->getChildHtml('wishlist_item_pager'); ?></div>
  11. <?= ($block->getChildHtml('wishlist.rss.link')) ?>
  12. <form class="form-wishlist-items" id="wishlist-view-form"
  13. data-mage-init='{"wishlist":{
  14. "addToCartUrl":<?= /* @noEscape */ $block->getItemAddToCartParams("%item%") ?>,
  15. "addAllToCartUrl":<?= /* @noEscape */ $block->getAddAllToCartParams() ?>,
  16. "commentString":""},
  17. "validation": {}}' action="<?= $block->escapeUrl($block->getUrl('wishlist/index/update', ['wishlist_id' => $block->getWishlistInstance()->getId()])) ?>" method="post">
  18. <?= $block->getChildHtml('top') ?>
  19. <?php if ($block->hasWishlistItems()): ?>
  20. <?= $block->getBlockHtml('formkey') ?>
  21. <?php $block->getChildBlock('items')->setItems($block->getWishlistItems()); ?>
  22. <?= $block->getChildHtml('items') ?>
  23. <?php else: ?>
  24. <div class="message info empty"><span><?= $block->escapeHtml(__('You have no items in your wish list.')) ?></span></div>
  25. <?php endif ?>
  26. <?= $block->getChildHtml('bottom') ?>
  27. <div class="actions-toolbar">
  28. <div class="primary">
  29. <?= $block->getChildHtml('control_buttons') ?>
  30. </div>
  31. <div class="secondary">
  32. <a href="<?= $block->escapeUrl($block->getBackUrl()) ?>" class="action back">
  33. <span><?= $block->escapeHtml(__('Back')) ?></span>
  34. </a>
  35. </div>
  36. </div>
  37. </form>
  38. <script id="form-tmpl" type="text/x-magento-template">
  39. <form id="wishlist-hidden-form" method="post" action="<%- data.url %>" class="no-display">
  40. <% if (data.qty) { %>
  41. <input name="qty" value="<%- data.qty %>">
  42. <% } %>
  43. <% if (data.item) { %>
  44. <input name="item" value="<%- data.item %>">
  45. <% } %>
  46. <% if (data.entity) { %>
  47. <input name="entity" value="<%- data.entity %>">
  48. <% } %>
  49. </form>
  50. </script>
  51. <div class="toolbar wishlist-toolbar"><br><?= $block->getChildHtml('wishlist_item_pager'); ?></div>
  52. <?php endif ?>