iisCART2000™ Documentation

 

iisCART2000 ITEMS OBJECT - METHODS

The Item object represents an individual item in the cart. Item objects can be accessed via the Items collection of the Cart object.


Property(Name As String) As String
Returns the value for a named property specified by Name. Named properties are defined in an HTML form which invokes a script containing AddToCart as demonstrated in Store.htm. Examples of named properties are Color, Size, FlyOrZipper etc.

For each item in Cart.Items
      response.write Item.Property("Color")
Next
 
PropertyName
Returns the name of a property. The sample below iterates through all of the items and displays each property name.

For each item in Cart.Items
     for i = 1 to item.propertycount
          response.write(item.propertyname(i))
     next
next
 
PropertyValue
Returns the value of a property.  The sample below iterates through all of the items and displays each property value.

For each item in Cart.Items
     for i = 1 to item.propertycount
          response.write(item.propertyValue(i))
     next
next
 
PropertyData
Returns the datastring for a property.  The sample below iterates through all of the items and displays each property datastring.

For each item in Cart.Items
     for i = 1 to item.propertycount
          response.write(item.propertydata(i))
     next
next
 
The difference between properties and custom fields
For some the difference between properties and custom fields may need clarification.  Properties are defined at the time of item addition and consist of size, color, or any options you choose to create.  You can define up to 8 properties for an item so that you could have a blue, extra large, cotton, pre-shrunk, short sleeve shirt etc.   Custom fields are different in that they are defined in the database at the items level or at the page level.  Data is populated by the component into the cart automatically.  The "showcustom" property of the displaycart method will display custom fields as a new column in the cart.  The idea is that each custom spot holds the same kind of data (custom1 for each item has the same data) where the first property could be different for every item.
 
How properties work with addtocart, setproperty format and in place editing
Any form/querystring value posted to the cart that is not expected is assumed to be a property.  The exception is fields passed with the IGNORE prefix such as IGNOREmyvalue.

If setpropertyformat is set to nameeditvalue or editvalue then an additional field must be passed for each property to enable in place editing.  This is the xDATA field.  This is required if you use the editvalue or nameeditvalue settings for setpropertyformat or wish to set per property price adjustments.

xDATA is expected with the name of the property field appended with DATA for example if we create a combo box named color it expects to see a correctly formatted colorDATA field.

This field contains the possible data selections, and the type of the edit display.  The possible types include text, multitext, combo, radio and check.

To continue with our example to have in place editing with 3 colors we would have:

<input type="hidden" name="colorDATA" value="Combo;Red,Green,Light Blue">

Per property price adjustments are also possible and are + or - an amount for example:

<input type="hidden" name="sizeDATA" value="radio;Small-1.5,Medium,Large+2.2">

In both of these cases one would expect a correct form element configured above the hidden field in HTML it would look like the following for a complete item addition including 2 properties that would allow in place editing:

<form method="post" action="addtocart.asp" name="1">
<input type="hidden" name="ITEMID" value="1111">
<INPUT type="hidden" name="itemname" VALUE="Cotton T-Shirt">
<INPUT type="hidden" name="price" VALUE="49.95"><br>
<INPUT type="hidden" NAME=WEIGHT VALUE="1"><br>
Quantity: <INPUT NAME=QUANTITY VALUE=1 SIZE=3>
<p><font face="Arial"><select size="1" name="Color">
<option selected>Red</option>
<option>Green</option>
<option>Light Blue</option>
</select></font></p>
<p><font face="Arial"><input type="radio" value="Small" name="size" checked>Small<br>
<input type="radio" value="Medium" name="size">Medium<br>
<input type="radio" value="Large" name="size">Large</font></p>
<p><font face="Arial"><input TYPE="submit" VALUE="Add to Cart"></font></p>
<input type="hidden" name="ColorDATA" value="Combo;Red,Green,Light Blue"><input type="hidden" name="SizeDATA" value="radio;Small,Medium,Large">
</form>


 

iisCART ITEMS OBJECT - PROPERTIES

These properties are retrieved from the Items database table when an item is added to the cart via the AddToCart method.


ItemID As String
Name As String
Description As String
Quantity
Price As String
Weight As String
Custom1 to Custom8
PropertyCount
PropertyValues
Tax
TaxRate
Adjust
AdjustRate
Value of X of product in cart. where X is one of the aforementioned properties. Usage:

For each item in Cart.Items
       response.write Item.Name & Item.Price
Next


 

� Corporate Web Solutions 1998, 1999, 2000, 2001.