<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
// @codingStandardsIgnoreFile

/** @var $block \Magento\Catalog\Block\Product\View */
?>
<?php $_product = $block->getProduct(); ?>
<?php $buttonTitle = __('Add to Cart'); ?>
<?php if ($_product->isSaleable()): ?>
    <div class="box-tocart">
        <div class="fieldset">
            <div class="form-inline input-group  field qty">
                <?php if ($block->shouldRenderQuantity()): ?>
                    <label for="qty" class="mr-2"><span><?php /* @escapeNotVerified */ echo __('Qty') ?></span></label>
                <?php endif; ?>
                <div class="input-group">
                    <?php if ($block->shouldRenderQuantity()): ?>


                        <input type="number"
                               name="qty"
                               id="qty"
                               value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>"
                               title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="form-control input-text qty"
                               data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
                               />

                    <?php endif; ?>
                    <div class="input-group-append">
                        <button type="submit"
                                title="<?php /* @escapeNotVerified */ echo $buttonTitle ?>"
                                class="btn btn-primary action primary tocart"
                                id="product-addtocart-button">
                            <span><?php /* @escapeNotVerified */ echo $buttonTitle ?></span>
                        </button>
                    </div>
                </div>
                <?php echo $block->getChildHtml('', true) ?>
            </div>
        </div>
    </div>
<?php endif; ?>
<script type="text/x-magento-init">
    {
    "#product_addtocart_form": {
    "Magento_Catalog/product/view/validation": {
    "radioCheckboxClosest": ".nested"
    }
    }
    }
</script>
<?php if (!$block->isRedirectToCartEnabled()) : ?>
    <script type="text/x-magento-init">
        {
        "#product_addtocart_form": {
        "catalogAddToCart": {
        "bindSubmit": false
        }
        }
        }
    </script>
<?php endif; ?>
