<?php
/**
 * Copyright © 2016 maijindou.com All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>

<?php
/**
 * Template for displaying product price at product view page, gift registry and wishlist
 *
 * @var $block \Magento\Catalog\Block\Product\Price
 */
?>
<?php
    /** @var $pricingHelper \Magento\Framework\Pricing\Helper\Data */
    $pricingHelper = $this->helper('Magento\Framework\Pricing\Helper\Data');
    /** @var $_catalogHelper \Magento\Catalog\Helper\Data */
    $_catalogHelper = $this->helper('Magento\Catalog\Helper\Data');

    /** @var $_product \Magento\Catalog\Model\Product */
    $_product = $block->getProduct();
    $_id = $_product->getId();
    $_msrpPrice = '';
?>
<div class="price-box msrp">
    <?php if ($_product->getMsrp()): ?>
        <?php $_msrpPrice = $pricingHelper->currency($_product->getMsrp(), true, false) ?>
        <span class="old-price"><?php /* @escapeNotVerified */ echo $_msrpPrice ?></span>
    <?php endif; ?>
    <?php if ($_catalogHelper->isShowPriceOnGesture($_product)): ?>
        <?php $priceElementId = 'product-price-' . $_id . $block->getIdSuffix(); ?>
        <span id="<?php /* @escapeNotVerified */ echo $priceElementId ?>" style="display: none"></span>
        <?php $popupId = 'msrp-popup-' . $_id . $block->getRandomString(20); ?>
        <a href="javascript:void(0);"
           id="<?php /* @escapeNotVerified */ echo($popupId);?>"
           data-mage-init='{"addToCart":{"popupId": "#<?php /* @escapeNotVerified */ echo($popupId);?>",
                                         "productName": "<?php /* @escapeNotVerified */ echo $_product->getName() ?>",
                                         "realPrice": <?php /* @escapeNotVerified */ echo $block->getRealPriceJs($_product) ?>,
                                         "msrpPrice": "<?php /* @escapeNotVerified */ echo $_msrpPrice ?>",
                                         "priceElementId":"<?php /* @escapeNotVerified */ echo $priceElementId ?>",
                                         "popupCartButtonId": "#map-popup-button",
                                         "cartForm": "#wishlist-view-form"}}'><?php /* @escapeNotVerified */ echo __('Click for price') ?>
        </a>
    <?php else: ?>
        <span class="msrp-message">
            <?php /* @escapeNotVerified */ echo $_catalogHelper->getMsrpPriceMessage($_product) ?>
        </span>
    <?php endif; ?>
    <?php $helpLinkId = 'msrp-help-' . $_id . $block->getRandomString(20); ?>
    <a href="javascript:void(0);" id="<?php /* @escapeNotVerified */ echo($helpLinkId);?>" data-mage-init='{"addToCart":{"helpLinkId": "#<?php /* @escapeNotVerified */ echo($helpLinkId);?>", "productName": "<?php /* @escapeNotVerified */ echo $_product->getName() ?>"}}' class="link tip"><?php /* @escapeNotVerified */ echo __("What's this?"); ?></a>
</div>
