When we use the term “product” in Reaction Commerce, we are referring to a single type of thing that is available in a shop catalog, for example, a pair of Best Brand shoes, model B. A product cannot be directly ordered, though. Each product must have at least one “variant” added to it.
A variant defines a certain product configuration, a set of configurable attributes that makes up a discrete, orderable item. For example, the “Pair of Best Brand Shoes, Model B” product might have three variants, “Size 9”, “Size 10”, and “Size 11”.
If necessary, a variant can have further variants, which we call “options” or “second level variants”. For example, the “Size 9” variant for “Pair of Best Brand Shoes, Model B”, may come in two different colors, black and red. So the “Size 9” variant would have two variants of its own, “Black” and “Red”.
It’s important to note that only a terminal variant may be ordered. So if a variant has options, a shopper will need to order one of the options, but if a variant has no options, that variant itself may be ordered (added to a cart).
Inventory and Badges
A product, variant and option can have different badge alerts appear in the storefront, depending on the inventory status. Here are the default badge settings:
- A product's
isLowQuantityis true when any variant or option has quantity that is less than or equal to its threshold
- A variant's
isLowQuantityis true when no options and quantity are less than or equal to its threshold
- A variant's
isLowQuantityis true when there are options and quantity that are less than or equal to its threshold for at least one of the options
- An option's
isLowQuantityis true when quantity is less than or equal to its threshold