Step to reproduce
Any help would be appreciated!Thanks.
Step to reproduce
Any help would be appreciated!Thanks.
You have to override the below path in your custom theme
Base file path :
vendor/magento/module-checkout/view/frontend/templates/cart/item/configure/updatecart.phtml
Move To Theme file path
app/design/frontend/<VENDOR_NAME>/<THEME_NAME>/Magento_Checkout/templates/cart/item/configure/updatecart.phtml
And add this below text in the input
<?= $block->getProductDefaultQty() * 1 ?>
Exmple:-
<input type="number"
name="qty"
id="qty"
min="0"
value="<?= $block->getProductDefaultQty() * 1 ?>"
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
class="input-text qty"
data-validate="<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"/>
Had the same issue. The main Reason was that js fired before the layout render. Check this file vendor/magento/module-checkout/view/frontend/web/js/view/configure/product-customer-data.js
productId = $(selectors.productIdSelector).val(),
This productId gets initial value null and after that is not reinitialized, which brakes the value population here.
if (!(data && data.items && data.items.length && productId)) {
return;
}
We moved productId initialization to another function so it is reinitialized later when the view is rendered. Not a clear solution but it works
Same bug after upgrading a 2.1 to 2.4. They changed the product/view/form.phtml , adding this line :
<input type="hidden" name="item" value="<?= (int)$block->getRequest()->getParam('id') ?>" />
Never forget to check changes in custom themes, even if it's a pain...
In my case, I disabled extension "php bin/magento module:disable BoostMyShop_AdvancedStock" and stock issue resolved.
Thanks,