Quantity
Overview
Quantity
is a discriminated union of possible ways quantity selection be presented for a product.
type Quantity =
DropdownQuantity
| TextQuantity
DropdownQuantity
Shows quantity selection as a dropdown.
Attributes
type
type: literal = 'dropdown'
minQuantity
type: number
The minimum purchasable quantity. Controls the smallest quantity selectable in the quantity selection dropdown.
maxQuantity
type: number
The maximum purchasable quantity. Controls the largest quantity selectable in the quantity selection dropdown.
step
type: number
The step size between the dropdown quantity values. Default is 1.
TextQuantity
Shows quantity selection as a text box with increment / decrement buttons.
Attributes
type
type: literal = 'text'
minQuantity
type: string
The minimum purchasable quantity. Validation error will be shown if user enters a quantity under this value.
maxQuantity
type: string
The maximum purchasable quantity. Validation error will be shown if user enters a quantity over this value.