Skip to content

feat: let a cart line hold 500 at most, and judge that with the minimum order - #7

Open
JasonYv wants to merge 1 commit into
mainfrom
feature/line-quantity-limit
Open

JasonYv wants to merge 1 commit into
mainfrom
feature/line-quantity-limit

Conversation

@JasonYv

@JasonYv JasonYv commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What this is

The owner set the most of one variant a cart line may hold: 500. It was 10,000, a guard against scripted abuse carried over from the previous implementation (design §11, decision 9).

At 500 it is a rule of the shop that a buyer will meet, so it is judged where the minimum order is — quantityIssue, which add-to-cart and cart pricing share. A line above it that is already in a cart cannot be ordered either, and says the figure. A quantity field carries it as max, on a product page and in the cart. The admin refuses a minimum order above it.

How it was verified

Check Result
lint, type check, build, both smoke runs Pass
Tests inside workerd 638 of 638, five of them new
Red and green 12 deliberate breakages, each one noticed: the boundary both ways, the figure itself, the order in which the ceiling and the stock are said, the max on both pages

The sample's largest minimum order is 200, so nothing in it is affected.

…um order

The ceiling was 10,000, a guard against scripted abuse carried over from the
previous implementation. The owner set it to 500 (design §11, decision 9),
which makes it a rule of the shop that a buyer will meet.

So it is judged where the minimum order is, in quantityIssue: a line above it
that is already in a cart cannot be ordered either, and says the figure. A
quantity field carries it as max, on a product page and in the cart, from
max_quantity in both views. The admin refuses a minimum order above it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant