diff --git a/blocks/commerce-cart/commerce-cart.js b/blocks/commerce-cart/commerce-cart.js index d8fc326fa9..f3b19988f3 100644 --- a/blocks/commerce-cart/commerce-cart.js +++ b/blocks/commerce-cart/commerce-cart.js @@ -30,6 +30,19 @@ export default async function decorate(block) { const isEmptyCart = isCartEmpty(cart); + const DROPDOWN_MAX_QUANTITY = 20; + + const dropdownOptions = Array.from( + { length: parseInt(DROPDOWN_MAX_QUANTITY, 10) }, + (_, i) => { + const quantityOption = i + 1; + return { + value: `${quantityOption}`, + text: `${quantityOption}`, + }; + }, + ); + // Layout const fragment = document.createRange().createContextualFragment(`