Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (56 sloc) 2.05 KB
__NAME__ purpose
specify tables and columns containing maximum allowed quantity for an item
__END__
__NAME__ see also
__END__
__NAME__ synopsis
<group choice='opt'><arg choice='plain'>=</arg><arg choice='plain'>?</arg></group><arg choice='opt'><replaceable>table</replaceable>:</arg><arg choice='plain'><replaceable>column</replaceable></arg>
__END__
__NAME__ description
The &conf-__FILENAME__; directive specifies &glos-database;s
and database columns containing the maximum allowed order quantity
for an item.
</para><para>
If the argument contains a colon "<literal>:</literal>", it is treated
as a <literal><replaceable>TABLE:COLUMN</replaceable></literal> specification.
Otherwise it indicates the name of the column and the table
defaults to the first &conf-ProductFiles; database.
</para><para>
The record with the matching product &glos-SKU; must exist in the
target database, or the quantity will be unlimited.
</para><para>
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.
</para><para>
As of &IC; 5.7.0, a field prefixed with <literal>=</literal> overrides
any previous value, while a field prefixed with <literal>?</literal>
overrides previous value only if the new value is greater than zero.
__END__
__NAME__ notes
__END__
__NAME__ example: Setting __FILENAME__
<programlisting>
MaxQuantityField max_quantity
</programlisting>
__END__
__NAME__ example: Setting __FILENAME__
<programlisting>
MaxQuantityField inventory:quantity
</programlisting>
__END__
__NAME__ example: Setting __FILENAME__
<programlisting>
MaxQuantityField inventory:quantity, products:in_stock products:on_hand
</programlisting>
Notice we can use commas and whitespace interchangeably to separate fields.
__END__
__NAME__ example: Setting __FILENAME__
Override any previous value with
<database class='field'>products:on_hand</database>,
if it contains a value greater than zero.
<programlisting>
MaxQuantityField inventory:quantity ?products:on_hand
</programlisting>
__END__