|> Home > Documentation > Latest documentation > Tutorials > How to set up an on-the-fly item|
How to set up an on-the-fly item
Interchange supplies an internal "onfly" subroutine, which will work according to the examples given below.
If you have the following your local (catalog.cfg) configuration:
then a basic link can be generated like this:
The mv_order_fly form parameter value can contain any number of fields, separated by a pipe (|) character, which will set corresponding parameters in the item attributes. The field(s) are expected to contain name=value pairs, and will be URI encoded by the [area] tag, in the example above. You can use this to set parameters such as the size and colour of your on-the-fly item.
The special mv_price attribute can be used in conjunction with the "$" CommonAdjust atom to set the price for checkout and display.
The [item-description] sub-tag, when used with an [item-list] tag, will use the item's description" attribute to display the product description in the cart. Note that [item-field description] and [item-data products description] will NOT work, as both of these sub-tags reference an actual column value for a row in the "products" table, and this is obviously not appropriate for on-the-fly items. Similarly, an attempt to generate a flypage for an on-the-fly item ([area 000101], for example) will fail, resulting in the display of the "missing" SpecialPage.
If you want to set up a UserTag to process on-the-fly items, it should accept a call like this:
The "mv_item_code" and "mv_order_fly" parameters are required to trigger Interchange's add_item routine, along with mv_todo=refresh to set the action.
The item will always act as if SeparateItems, or mv_separate_items, is set.
Multiple items can be ordered at once by stacking the variables. If there is only one mv_order_item instance, however, you can stack the "mv_order_fly" variable so that all are concatenated together as using "|" symbols. The above example could be done as:
The following two forms correspond to the above two examples, in order, with the slight refinement of adding a quantity: