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