MaxQuantityField — specify tables and columns containing maximum allowed quantity for an item
The MaxQuantityField
directive specifies databases
and database columns containing the maximum allowed order quantity
for an item.
If the argument contains a colon ":
", it is treated
as a
specification.
Otherwise it indicates the name of the column and the table
defaults to the first TABLE:COLUMN
ProductFiles
database.
The record with the matching product SKU must exist in the target database, or the quantity will be unlimited.
It is possible to specify multiple database fields (separated by commas or spaces), in which case the maximum quantity allowed is set to the sum of all quantities found.
As of Interchange 5.7.0, a field prefixed with =
overrides
any previous value, while a field prefixed with ?
overrides previous value only if the new value is greater than zero.
Example: Setting MaxQuantityField
MaxQuantityField inventory:quantity, products:in_stock products:on_hand
Notice we can use commas and whitespace interchangeably to separate fields.
Example: Setting MaxQuantityField
Override any previous value with products:on_hand, if it contains a value greater than zero.
MaxQuantityField inventory:quantity ?products:on_hand