<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var $block \Magento\Catalog\Block\Product\View*/
?>
<?php
$_product = $block->getProduct();
$_wishlistSubmitParams = $this->helper('Magento\Wishlist\Helper\Data')->getAddParams($_product);
$compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
?>

<div class="product-addto-links" data-role="add-to-links">
    <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?>
        <a href="#"
            class="action towishlist"
            data-post='<?php /* @escapeNotVerified */ echo $_wishlistSubmitParams; ?>'
            data-action="add-to-wishlist"><span><?php /* @escapeNotVerified */ echo __('Add to Wish List') ?></span></a>
    <?php endif; ?>
    <a href="#" data-post='<?php /* @escapeNotVerified */ echo $compareHelper->getPostDataParams($_product);?>'
        data-role="add-to-links"
        class="action tocompare"><span><?php /* @escapeNotVerified */ echo __('Add to Compare') ?></span></a>
</div>
<script type="text/x-magento-init">
    {
        "body": {
            "addToWishlist": <?php /* @escapeNotVerified */ echo $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($block->getWishlistOptions())?>
        }
    }
</script>
