Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
shared.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
10 ?>
11 
12 <?php if ($block->hasWishlistItems()): ?>
13  <form class="form shared wishlist" action="<?= $block->escapeUrl($block->getUrl('wishlist/index/update')) ?>" method="post">
14  <div class="wishlist table-wrapper">
15  <table class="table data wishlist" id="wishlist-table">
16  <caption class="table-caption"><?= $block->escapeHtml(__('Wish List')) ?></caption>
17  <thead>
18  <tr>
19  <th class="col product" scope="col"><?= $block->escapeHtml(__('Product')) ?></th>
20  <th class="col comment" scope="col"><?= $block->escapeHtml(__('Comment')) ?></th>
21  <th class="col actions" scope="col"><?= $block->escapeHtml(__('Add to Cart')) ?></th>
22  </tr>
23  </thead>
24  <tbody>
25  <?php foreach ($block->getWishlistItems() as $item): ?>
26  <?php
27  $product = $item->getProduct();
28  $isVisibleProduct = $product->isVisibleInSiteVisibility();
29  ?>
30  <tr>
31  <td data-th="<?= $block->escapeHtmlAttr(__('Product')) ?>" class="col product">
32  <a class="product photo" href="<?= $block->escapeUrl($block->getProductUrl($item)) ?>" title="<?= $block->escapeHtmlAttr($product->getName()) ?>">
33  <?= $block->getImage($product, 'customer_shared_wishlist')->toHtml() ?>
34  </a>
35  <strong class="product name">
36  <a href="<?= $block->escapeUrl($block->getProductUrl($item)) ?>">
37  <?= $block->escapeHtml($product->getName()) ?>
38  </a>
39  </strong>
40  <?php
41  echo $block->getProductPriceHtml(
42  $product,
43  'wishlist_configured_price',
44  \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST,
45  ['item' => $item]
46  );
47  ?>
48  <?= $block->getDetailsHtml($item) ?>
49  </td>
50  <td data-th="<?= $block->escapeHtmlAttr(__('Comment')) ?>" class="col comment"><?= /* @noEscape */ $block->getEscapedDescription($item) ?></td>
51  <td data-th="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>" class="col actions" data-role="add-to-links">
52  <?php if ($product->isSaleable()): ?>
53  <?php if ($isVisibleProduct): ?>
54  <button type="button"
55  title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>"
56  data-post='<?= /* @noEscape */ $block->getSharedItemAddToCartUrl($item) ?>'
57  class="action tocart">
58  <span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
59  </button>
60  <?php endif ?>
61  <?php endif; ?>
62  <a href="#" data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($item) ?>' onclick="location.assign(this.href); return false;" class="action towishlist" data-action="add-to-wishlist">
63  <span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
64  </a>
65  </td>
66  </tr>
67  <?php endforeach ?>
68  </tbody>
69  </table>
70  </div>
71 
72  <div class="actions-toolbar">
73  <?php if ($block->isSaleable()):?>
74  <div class="primary">
75  <button type="button"
76  title="<?= $block->escapeHtmlAttr(__('Add All to Cart')) ?>"
77  data-post='<?= $block->escapeUrl($block->getSharedAddAllToCartUrl()) ?>'
78  class="action tocart primary">
79  <span><?= $block->escapeHtml(__('Add All to Cart')) ?></span>
80  </button>
81  </div>
82  <?php endif;?>
83  <div class="secondary">
84  <a href="<?= $block->escapeUrl($block->getBackUrl()) ?>" class="action back">
85  <span><?= $block->escapeHtml(__('Back')) ?></span>
86  </a>
87  </div>
88  </div>
89  </form>
90 <?php else: ?>
91  <div class="message info empty"><div><?= $block->escapeHtml(__('Wish List is empty now.')) ?></div></div>
92 <?php endif ?>
$isVisibleProduct
Definition: shared.phtml:28
foreach( $this->main as $item) endforeach
Definition: side-menu.phtml:10
__()
Definition: __.php:13
jquery extjs ext tree mage adminhtml form
Definition: tree.phtml:41
$block
Definition: block.php:8
if( $product->isSaleable())( $isVisibleProduct)(__( 'Add to Cart')) ?>" data-post endif endif
Definition: shared.phtml:52