I want change qty box in dropdown .So I'm override template file./vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml
<referenceBlock name="product.info.addtocart">
<action method="setTemplate">
<argument name="template" xsi:type="string">Www_QtyDropdown::product/view/addtocart.phtml</argument>
</action>
</referenceBlock>
addtocart.phtml
<?php $_product = $block->getProduct(); ?>
<?php $qty = $block->getStockMaximumQty(); ?>
<?php $buttonTitle = __('Add to Cart'); ?>
<?php if ($_product->isSaleable()): ?>
<div class="box-tocart">
<div class="fieldset">
<?php if ($block->shouldRenderQuantity()): ?>
<div class="field qty">
<label class="label" for="qty"><span><?= /* @escapeNotVerified */ __('Qty') ?></span></label>
<div class="control">
<select name="qty" id="qty" title="<?php /* @escapeNotVerified */ echo __('Qty') ?>"
class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>">
<?php if ($qty > 4) { ?>
<option value = "0"></option>
<?php $i = 1; ?>
<?php while ($i <= 4) {
?>
<option value="<?php echo $block->getProductDefaultQty() * $i; ?>"><?php echo $block->getProductDefaultQty() * $i; ?></option>
<?php $i++; ?>
<?php } ?>
<?php } else {
?>
<option value = "0"></option>
<?php $i = 1;
?>
<?php while ($i <= $qty) { ?>
<option value="<?php echo $block->getProductDefaultQty() * $i; ?>"><?php echo $block->getProductDefaultQty() * $i; ?></option>
<?php $i++; ?>
<?php } ?>
<?php } ?>
</select>
</div>
</div>
<?php endif; ?>
But is not working for configurable product.If I need any modification in my code.