<?php
/**
 * Maho
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2024 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/** @var Mage_Catalog_Block_Product_View $this */
?>

<?php $_product = $this->getProduct(); ?>

<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow()) : ?>
    <li>
        <a href="#"
           onclick="customFormSubmit(
                   '<?= $this->helper('wishlist')->getAddUrlWithCustomParams($_product, [], false) ?>',
                   '<?= $this->escapeHtml(json_encode(['form_key' => $this->getFormKey()])) ?>',
                   'post')"
           class="link-wishlist">
            <?= $this->__('Add to Wishlist') ?>
        </a>
    </li>
<?php endif ?>
<?php
    $_compareUrl = $this->helper('catalog/product_compare')->getAddUrlCustom($_product, false);
?>
<?php if($_compareUrl) : ?>
    <li>
        <span class="separator">|</span>
        <a href="#"
           class="link-compare"
           onclick="customFormSubmit(
                   '<?= $_compareUrl ?>',
                   '<?= $this->escapeHtml(json_encode(['form_key' => $this->getFormKey()])) ?>',
                   'post')">
            <?= $this->__('Add to Compare') ?>
        </a>
    </li>
<?php endif ?>
</ul>
