Skip to main content

Quantity

Overview​

Quantity is a discriminated union of possible ways quantity selection is presented for a product.

type Quantity =  
DropdownQuantity
| TextQuantity

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. A validation error will be shown if the user enters a quantity under this value.

maxQuantity​

type: string


The maximum purchasable quantity. A validation error will be shown if the user enters a quantity over this value.