4.51. order

Expands into a hypertext link which will include the specified item in the list of products to order and display the order page.

4.51.1. Summary

    [order code quantity]Link Text</A>
    [order code=os28044 quantity=2]Link Text</A>
Parameters Description Default
code This is the unique identifier for the item, typically the SKU in the products table none
quantity Quantity to order 1
Attributes Default
code No
page SpecialPage order
cart main cart
base ProductFiles array
area off
interpolate (reparse) No
Other_Characteristics  
Invalidates cache No
Container tag No
Has end tag No ([/order] is a macro for </A>)

Tag expansion example:

    [order os28044 2]Buy Framing Hammer[/order]
---
    <A HREF="http://localhost.localdomain/cgi-bin/tag72/ord/basket?\
    mv_session_id=6CZ2whqo&mv_pc=1&mv_action=refresh&\
    mv_order_item=os28044&mv_order_quantity=3">Buy Framing Hammer</A>

ASP-like Perl call:

    $Tag->order($code, $quantity);

4.51.2. Description

Expands into a hypertext link which will include the specified code in the list of products to order and display the order page.

code should be a product code listed in one of the "products" databases. The optional argument base constrains the order to a particular products file. If not specified, all tables defined as ProductFiles will be searched in sequence for the item.

The optional argument cart selects the shopping cart where the item will be placed.

page allows you to specify a different order page than the default one specified by SpecialPage order.

4.51.3. How to Order an Item

Interchange can either use a form-based order or a link-based order to place an item in the shopping cart. The order tag creates a link-based order.

You can use the area tag with form variables if you need more control, for example, to change frames for the order:

   <A HREF="[area href=ord/basket
                  form="mv_order_item=os28044
                        mv_order_quantity=2
                        mv_action=refresh"]"
    TARGET=newframe> Order Framing Hammer</A>

This can also be done more easily with the area option to the order tag:

    <A HREF="[order code=os28044 quantity=2 area=1]"
         TARGET=newframe> Order Framing Hammer</A>

To order with a form, you set the form variable mv_order_item to the item-code/SKU and use the refresh action:

   <FORM ACTION="[process]" METHOD=POST>
   <INPUT TYPE=hidden  NAME="mv_todo"        VALUE="refresh">
   <INPUT TYPE=hidden  NAME="mv_order_item"  VALUE="os28044">

   Order <INPUT NAME="mv_order_quantity" SIZE=3 VALUE=1> Framing Hammer

   <INPUT TYPE=submit VALUE="Order!">
   </FORM>

Groups of items may be batched:

   <FORM ACTION="[process]" METHOD=POST>
   <INPUT TYPE=hidden  NAME="mv_todo"        VALUE="refresh">

   <INPUT TYPE=hidden  NAME="mv_order_item"  VALUE="TK112">
   <INPUT NAME="mv_order_quantity" SIZE=3> Standard Toaster

   <INPUT TYPE=hidden  NAME="mv_order_item"  VALUE="TK200">
   <INPUT NAME="mv_order_quantity" SIZE=3> Super Toaster

   <INPUT TYPE=submit VALUE="Order!">
   </FORM>

Items that have a quantity of zero (or blank) will be skipped. Only items with a positive quantity will be placed in the basket.

Attributes like size or color may be specified at time of order. See the accessories tag for detail.