Perlshop 4 - The ITEM_DATA Tag

Overview

The ITEM_DATA tag became available with Perlshop v4.3.

This single tag is intended for use as a replacement for the following traditional Perlshop catalog data description tags:

ITEM_ID, ITEM_NAME, ITEM_PRICE, ITEM_WEIGHT, ITEM_SHIPTYPE, ITEM_TAXTYPE, ITEM_OPTION1, ITEM_OPTION2, ITEM_OPTION3, QTY_MIN, QTY_MAX


Use

This following product definition tags show how a catalog item is typically defined for a Perlshop catalog page:
<input type=hidden name="item_id" value="pn324">
<input type=hidden name="item_name" value="Basic Widget">
<input type=hidden name="item_price" value="12.50">
<input type=hidden name="item_weight" value="3.5">
<input type=text   name="qty" value="1" size=4 maxlength=4>
<input type=submit name="action" value="Order">


Using the item_data tag, this example can be reduced as follows:

<input type=hidden name="item_data" value="id:pn324|name:Basic Widget|price:12.50|weight:3.5">
<input type=text   name="qty" value="1" size=4 maxlength=4>
<input type=submit name="action" value="Order">


Detailed Information

The value of the item_data tag is composed of a group of value specifications. These value specifications are separated by the vertical bar character '|'. Each value specification is a name/value pair, with the name and value being separated by a colon. The item data tag may contain any number of name/value pairs.

Every one of the traditional Perlshop item description tags has an equivalent item_data tag value specification. In the example above, the 'id' value replaces the item_id tag, the 'name' value replaces the item_name tag, the 'price' value replaces the item_price tag, and the 'weight' value replaces the item_weight tag.

Every one of the traditional Perlshop item description tags can be replaced by an equivalent item_data value. The names of these item_data values are the same as the traditional tag names, with each of these names also have an abbreviated form. The following table lists each traditional Perlshop tag, the item_data name equivalent, and the abbreviated form of that name.


Item_Data Keyword equivalents

Traditional Perlshop Tag ITEM_DATA Keyword ITEM_DATA Abbreviation
item_id id i
item_name name n
item_option1 option1 o1
item_option2 option2 o2
item_option3 option3 o3
item_price price p
item_shiptype shiptype s
item_taxtype taxtype t
item_weight weight w
qty qty q
qty_min qtymin qn
qty_max qtymax qx


Example

Here is another example of a product defined using traditional Perlshop data tags:
<input type=hidden name="item_id" value="pn324">
<input type=hidden name="item_name" value="Basic Widget">
<input type=hidden name="item_price" value="12.50">
<input type=hidden name="item_shiptype" value="free">
<input type=hidden name="item_weight" value="3.5">
<input type=text   name="qty" value="1" size=4 maxlength=4>
<input type=submit name="action" value="Order">


Using an item_data tag, this example can be reduced as follows:

<input type=hidden name="item_data" value="id:pn324|name:Basic Widget|price:12.50|shiptype:free|weight:3.5">
<input type=text   name="qty" value="1" size=4 maxlength=4>
<input type=submit name="action" value="Order">


Using the abbreviated forms of the item_data field names, this example can be reduced even further:

<input type=hidden name="item_data" value="i:pn324|n:Basic Widget|p:12.50|s:free|w:3.5">
<input type=text   name="qty" value="1" size=4 maxlength=4>
<input type=submit name="action" value="Order">