Item Lists

### Index Up << >>

## Item Lists

Within any page, the `[item-list cart*]` element shows a list of all the items ordered by the customer so far. It works by repeating the source between `[item-list]` and `[/item-list]` once for each item ordered.

NOTE: The special tags that reference item within the list are not normal MiniVend tags, do not take named attributes, and cannot be contained in an HTML tag (other than to substitute for one of its values or provide a conditional container). They are interpreted only inside their corresponding list container. Normal MiniVend tags can be interspersed, though they will be interpreted after all of the list-specific tags.

Between the item_list markers the following elements will return information for the current item:

[if-item-data table column]
  If the database field `column` in table table is non-blank, the following text up to the `[/if-item-data]` tag is substituted. This can be used to substitute IMG or other tags only if the corresponding source item is present. Also accepts a `[else]else text[/else]` pair for the opposite condition.

  NOTE: This tag does not nest with other `[if-item-data ...]` tags.

[if-item-data ! table column]
  Reverses sense for `[if-item-data]`.

[/if-item-data]
  Terminates an `[if-item-data table column]` element.

[if-item-field fieldname]
  If the products database field fieldname is non-blank, the following text up to the `[/if-item-field]` tag is substituted. If you have more than one products database table (see ProductFiles), it will check them in order until a matching key is found. This can be used to substitute IMG or other tags only if the corresponding source item is present. Also accepts a `[else]else text[/else]` pair for the opposite condition.

  NOTE: This tag does not nest with other `[if-item-field ...]` tags.

[if-item-field ! fieldname]
  Reverses sense for `[if-item-field]`.

[/if-item-field]
  Terminates an `[if-item-field fieldname]` element.

[item-accessories attribute*, type*, field*, database*, name*]
  Evaluates to the value of the Accessories database entry for the item. If passed any of the optional arguments, initiates special processing of item attributes based on entries in the product database.

[item-alternate N] DIVISIBLE [else] NOT DIVISIBLE [/else][/item-alternate]
  Set up an alternation sequence. If the item-increment is divisible by N, the text will be displayed. If an `[else]NOT DIVISIBLE TEXT[/else]` is present, then the NOT DIVISIBLE TEXT will be displayed.

  For example:

          [item-alternate 2]EVEN[else]ODD[/else][/item-alternate]
          [item-alternate 3]BY 3[else]NOT by 3[/else][/item-alternate]

[/item-alternate]
  Terminate the alternation area.

[item-code]
  Evaluates to the product code for the current item.

[item-data database fieldname]
  Evaluates to the field name fieldname in the arbitrary database table database, for the current item.

[item-description]
  Evaluates to the product description (from the products file) for the current item.

[item-field fieldname]
  The [item-field ...] tag is special in that it looks in any of the tables defined as ProductFiles, in that order, for the data, returning the value only if that key is defined. In most catalogs, where ProductFiles is not defined (i.e. the demo), `[item-field title]` is equivalent to `[item-data products title]`.

  Evaluates to the field name fieldname in the products database, for the current item. If the item is not found in the first of the ProductFiles, all will be searched in sequence.

[item-increment]
  Evaluates to the number of the item in the match list. Used for numbering search matches or order items in the list.

[item-last]tags[/item-last]
  Evaluates the output of the MiniVend tags encased inside the tags, and if it evaluates to a numerical non-zero number (i.e. 1, 23, or -1) then the list iteration will terminate. If the evaluated number is negative, then the item itself will be skipped. If the evaluated number is positive, then the item itself will be shown but will be last on the list.

            [item-last][calc]
              return -1 if '[item-field weight]' eq '';
              return 1 if '[item-field weight]' < 1;
              return 0;
              [/calc][/item-last]

  If this is contained in your `[item-list]` (or `[search-list]` or flypage) and the weight field is empty, then a numerical `-1` will be output from the `[calc][/calc]` tags; the list will end and the item will not be shown. If the product's weight field is less than 1, a numerical 1 is output. The item will be shown, but will be the last item shown. (If it is an `[item-list]`, any price for the item will still be added to the subtotal.) NOTE: no HTML style.

[item-modifier attribute]
  Evaluates to the modifier value of `attribute` for the current item.

[item-next]tags[/item_next]
  Evaluates the output of the MiniVend tags encased inside, and if it evaluates to a numerical non-zero number (i.e. 1, 23, or -1) then the item will be skipped with no output. Example:

            [item-next][calc][item-field weight] < 1[/calc][/item-next]

  If this is contained in your `[item-list]` (or `[search-list]` or flypage) and the product's weight field is less than 1, then a numerical `1` will be output from the [calc][/calc] operation. The item will not be shown. (If it is an `[item-list]`, any price for the item will still be added to the subtotal.)

[item-price n* noformat*]
  Evaluates to the price for quantity `n` (from the products file) of the current item, with currency formatting. If the optional ``noformat'' is set, then currency formatting will not be applied.

[discount-price n* noformat*]
  Evaluates to the discount price for quantity `n` (from the products file) of the current item, with currency formatting. If the optional ``noformat'' is set, then currency formatting will not be applied. Returns regular price if not discounted.

[item-discount]
  Returns the difference between the regular price and the discounted price.

[item-quantity]
  Evaluates to the quantity ordered for the current item.

[item-subtotal]
  Evaluates to the subtotal (quantity * price) for the current item. Quantity price breaks are taken into account.

[modifier-name attribute]
  Evaluates to the name to give an input box in which the customer can specify the modifier to the ordered item.

[quantity-name]
  Evaluates to the name to give an input box in which the customer can enter the quantity to order.

### Index Up << >>