<?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_Core_Block_Template $this */
?>
<?php if (Mage::helper('catalog')->isMsrpEnabled()): ?>
<div id="map-popup" class="map-popup" style="display:none;">
    <a href="#" class="map-popup-close" id="map-popup-close">x</a>
    <div class="map-popup-arrow"></div>
    <div class="map-popup-heading"><h2 id="map-popup-heading"></h2></div>
    <div class="map-popup-content" id="map-popup-content">
        <div class="map-popup-checkout">
            <form action="" method="POST" id="product_addtocart_form_from_popup">
                <input type="hidden" name="product" class="product_id" value="" id="map-popup-product-id" />
                <div class="additional-addtocart-box">
                    <?= $this->getChildHtml() ?>
                </div>
                <button type="button" title="<?= Mage::helper('core')->quoteEscape($this->__('Add to Cart')) ?>" class="button btn-cart" id="map-popup-button"><?= $this->__('Add to Cart') ?></button>
            </form>
        </div>
        <div class="map-popup-msrp" id="map-popup-msrp-box"><strong><?= $this->__('Price') ?>:</strong> <span style="text-decoration:line-through;" id="map-popup-msrp"></span></div>
        <div class="map-popup-price" id="map-popup-price-box"><strong><?= $this->__('Actual Price') ?>:</strong> <span id="map-popup-price"></span></div>
        <script type="text/javascript">
            document.addEventListener("DOMContentLoaded", () => {
                Catalog.Map.bindProductForm();
            });
        </script>
    </div>
    <div class="map-popup-text" id="map-popup-text"><?= Mage::helper('catalog')->getMsrpExplanationMessage() ?></div>
    <div class="map-popup-text" id="map-popup-text-what-this"><?= Mage::helper('catalog')->getMsrpExplanationMessageWhatsThis() ?></div>
</div>
<?php endif ?>
