sidebar.phtml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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\Sidebar $block */
  8. ?>
  9. <?php
  10. $wishlistHelper = $this->helper('Magento\Wishlist\Helper\Data');
  11. ?>
  12. <?php if ($wishlistHelper->isAllow()) : ?>
  13. <div class="block block-wishlist" data-bind="scope: 'wishlist'">
  14. <div class="block-title">
  15. <strong role="heading" aria-level="2"><?= $block->escapeHtml($block->getTitle()) ?></strong>
  16. <!-- ko if: wishlist().counter -->
  17. <span data-bind="text: wishlist().counter" class="counter"></span>
  18. <!-- /ko -->
  19. </div>
  20. <div class="block-content">
  21. <strong class="subtitle"><?= $block->escapeHtml(__('Last Added Items')) ?></strong>
  22. <!-- ko if: wishlist().counter -->
  23. <ol class="product-items no-display" id="wishlist-sidebar" data-bind="foreach: wishlist().items, css: {'no-display': null}">
  24. <li class="product-item">
  25. <div class="product-item-info">
  26. <a class="product-item-photo" data-bind="attr: { href: product_url, title: product_name }">
  27. <!-- ko template: {name: $data.image.template, data: $data.image} --><!-- /ko -->
  28. </a>
  29. <div class="product-item-details">
  30. <strong class="product-item-name">
  31. <a data-bind="attr: { href: product_url }" class="product-item-link">
  32. <span data-bind="html: product_name"></span>
  33. </a>
  34. </strong>
  35. <div data-bind="html: product_price"></div>
  36. <div class="product-item-actions">
  37. <!-- ko if: product_is_saleable_and_visible -->
  38. <div class="actions-primary">
  39. <!-- ko if: product_has_required_options -->
  40. <a href="#" data-bind="attr: {'data-post': add_to_cart_params}" class="action tocart primary"><span><?= $block->escapeHtml(__('Add to Cart')) ?></span></a>
  41. <!-- /ko -->
  42. <!-- ko ifnot: product_has_required_options -->
  43. <button type="button" class="action tocart primary" data-bind="attr: {'data-post': add_to_cart_params}"><span><?= $block->escapeHtml(__('Add to Cart')) ?></span></button>
  44. <!-- /ko -->
  45. </div>
  46. <!-- /ko -->
  47. <div class="actions-secondary">
  48. <a href="#" data-bind="attr: {'data-post': delete_item_params}"
  49. title="<?= $block->escapeHtmlAttr(__('Remove This Item')) ?>"
  50. class="btn-remove action delete">
  51. <span><?= $block->escapeHtml(__('Remove This Item')) ?></span>
  52. </a>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </li>
  58. </ol>
  59. <div class="actions-toolbar no-display" data-bind="css: {'no-display': null}">
  60. <div class="primary">
  61. <a class="action details"
  62. href="<?= $block->escapeUrl($this->helper('Magento\Wishlist\Helper\Data')->getListUrl()) ?>"
  63. title="<?= $block->escapeHtmlAttr(__('Go to Wish List')) ?>"><span><?= $block->escapeHtml(__('Go to Wish List')) ?></span></a>
  64. </div>
  65. </div>
  66. <!-- /ko -->
  67. <!-- ko ifnot: wishlist().counter -->
  68. <div class="empty"><?= $block->escapeHtml(__('You have no items in your wish list.')) ?></div>
  69. <!-- /ko -->
  70. </div>
  71. </div>
  72. <script type="text/x-magento-init">
  73. {
  74. "*": {
  75. "Magento_Ui/js/core/app": {
  76. "components": {
  77. "wishlist": {
  78. "component": "Magento_Wishlist/js/view/wishlist"
  79. }
  80. }
  81. }
  82. }
  83. }
  84. </script>
  85. <?php endif ?>