<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/* @var $block \Magento\Catalog\Block\Product\View\Options */
?>

<?php $_options = $block->decorateArray($block->getOptions()) ?>
<?php $_productId = $block->getProduct()->getId() ?>

<?php if (count($_options)):?>
<script type="text/x-magento-init">
    {
        "#ajaxcart_form_popup<?php echo $block->getProduct()->getId();?> #product_addtocart_form": {
            "priceOptions": {
                "optionConfig": <?php /* @escapeNotVerified */ echo $block->getJsonConfig()?>,
                "controlContainer": ".field",
                "priceHolderSelector": "#ajaxcart_form_popup<?php echo $block->getProduct()->getId();?> [data-product-id='<?php echo $block->escapeHtml($_productId)?>'][data-role=priceBox]"
            }
        }
    }
</script>
    <?php foreach ($_options as $_option): ?>
        <?php echo $block->getOptionHtml($_option) ?>
    <?php endforeach; ?>
<?php endif; ?>
