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

// @codingStandardsIgnoreFile

?>
<?php
/**
 * \Magento\Sales\Block\Adminhtml\Order\Create\Coupons
 *
 */
?>

<div class="admin__field field-apply-coupon-code">
    <label class="admin__field-label"><span><?= /* @escapeNotVerified */ __('Apply Coupon Code') ?></span></label>
    <div class="admin__field-control">
        <input type="text" class="admin__control-text" id="coupons:code" value="" name="coupon_code" />
        <?= $block->getButtonHtml(__('Apply'), 'order.applyCoupon($F(\'coupons:code\'))') ?>
        <?php if ($block->getCouponCode()): ?>
        <p class="added-coupon-code">
            <span><?= $block->escapeHtml($block->getCouponCode()) ?></span>
            <a href="#" onclick="order.applyCoupon(''); return false;" title="<?= /* @escapeNotVerified */ __('Remove Coupon Code') ?>"
               class="action-remove"><span><?= /* @escapeNotVerified */ __('Remove') ?></span></a>
        </p>
        <?php endif; ?>
        <script>
            require(["Magento_Sales/order/create/form"], function(){

                order.overlay('shipping-method-overlay', <?php if ($block->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
                order.overlay('address-shipping-overlay', <?php if ($block->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);

            });
        </script>
    </div>
</div>
