Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
addto.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
10 ?>
11 
12 <div class="product-addto-links" data-role="add-to-links">
13  <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?>
14  <a href="#" data-post='<?= /* @noEscape */ $block->getUpdateParams() ?>' class="action towishlist updated" data-action="add-to-wishlist">
15  <span><?= $block->escapeHtml(__('Update Wish List')) ?></span>
16  </a>
17  <?php endif; ?>
18  <?php $_product = $block->getProduct(); ?>
19  <?php $_compareUrl = $this->helper('Magento\Catalog\Helper\Product\Compare')->getAddUrl($_product); ?>
20  <?php if ($_compareUrl) : ?>
21  <a href="<?= $block->escapeUrl($_compareUrl) ?>" class="action tocompare">
22  <span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
23  </a>
24  <?php endif; ?>
25 </div>
26 <script type="text/x-magento-init">
27  {
28  "body": {
29  "addToWishlist": <?= /* @noEscape */ $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($block->getWishlistOptions()) ?>
30  }
31  }
32 </script>
__()
Definition: __.php:13
$block
Definition: block.php:8
$_compareUrl
Definition: addto.phtml:19
if( $_compareUrl)( $_compareUrl) ?>" class endif
Definition: addto.phtml:20
$_product
Definition: addto.phtml:18