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

/* @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">
    {
        "#product_addtocart_form": {
            "priceOptions": {
                "optionConfig": <?= /* @noEscape */ $block->getJsonConfig() ?>,
                "controlContainer": ".field",
                "priceHolderSelector": "[data-product-id='<?= $block->escapeHtml($_productId) ?>'][data-role=priceBox]"
            }
        }
    }
</script>
    <?php foreach ($_options as $_option) :?>
        <?= $block->getOptionHtml($_option) ?>
    <?php endforeach; ?>
<?php endif; ?>
