F A Q - A m e r i c a r t   T a g s

Q:
How do I tag an item for use by Americart?

A:
There are a lot of variants, but the basic method uses a very simple form submitted to our server:

<form action=http://www.cartserver.com/sc/cart.cgi method=post>
<input type=hidden name=item value="a-1358^pn-1^description^5.00^1">
<input type=image name=add src="anything.gif" border=0>
</form>

Line 1) Opens the form and points it to Americart.
Line 2) The "item" variable contains the info about the product.
Line 3) The graphic used as the submit button.
Line 4) Close the form.

Q:
What is that up-arrow character that is inside the "item" variable?

A:
That is the ^ character, and we use it to separate different fields combined into a single variable. "item" contains 10 separate fields, the first five of which are mandatory:

cart-id ^ part number ^ description ^ cost ^ quantity

This method avoids having five separate "hidden" variables to convey the same information, saving time and space.

Q:
How can I allow different sizes of a given item?

A:
Examples are in the demo pages, but here is a sample of html code you'd put inside the form tags:

<select name=op1>
  <option>small
  <option>medium
  <option>large
</select>

This method is very basic. Whichever option they select is appended to the product description in the cart display and the order form you receive. You could also form an option like this: <option value="SM">Small frisbee</option>

That is a way to abbreviate what is shown in the cart display while still offering the shoper a lot more information to make their choice.

Q:
All options variables are named op1, op2, etc. Why is that?

A:
That is true for regular single item method tags. The cart ignores all variables it does not recognize. Currently, it looks at: "item", and "op1", "op2",..."op43", "op44"

Q:
Some options in the demo pages are mentioned inside the "item" variable and some are not. Why?

A:
Options can be one of two classes, simple, or special.

Simple options are those not affecting price, quantity, or shipping fee. Just place them inside the <form> </form> tags, and Americart will append their data to the product description in the cart display. Size, color, those sorts of things.

Special options are those which effect the price or quantity of an item. To use them properly, you must have the option name listed in the appropriate field of the "item" variable so Americart will know what to do with the data sent. Regardless of simple or special, they are still named op1-44. See below and in the demo pages to see how to get op vars to modify item prices and quantites.

Q:
How do I use a special option to allow customers to put more than one of a certain item into their cart at a time?

A:
Let's say someone wanted 100 feet of rope. Putting 1 foot in and increasing quantity 99 times would be ridiculous, and so we offer the following:

<input type=hidden name=item value="a-1358^pn-1^rope^5.00^op2">
<input type=text name=op2 size=3 value="1">

Notice that in the quantity field of the "item" variable, instead of the usual 1, we put op2. That tells the cart to substitute the value of option op2 into that field. If the customer puts 100 into the op2 text box, he gets 100 feet of rope instead of one!

Q:
One of my options affects the price of the item. How do I tag that?

A:
List the option affecting price in the cost field of the item variable:

  <input type=hidden name=item value="a-1358^xyz^item desc^op1^1">

This tells the cart to look in op1 to find the price:

<select name=op1>
  <option value="Large - $4.00">Large</option>
  <option value="Medium - $3.00">Medium</option>
  <option value="Small - $1.50">Small</option>
</select>

Notice the "space dash space" in the various op1 value fields? That must be there to separate the description from the cost.

Q:
I want to offer more than one option affecting price. Can I do that?

A:
Yes. List options affecting price in the cost field of the item variable:

<input type=hidden name=item value="a-1358^xyz^item desc^op2op3^1">
OR (if you want to set a "base price" of $5.27)
<input type=hidden name=item value="a-1358^xyz^item desc^5.27op2op3^1">

The cart then looks in op2, and op3 for price related information. Each of those options can also contain descriptive text, but may be price only.

<input type=checkbox name=op2 value="giftwrap - $2.00"> Check for giftwrap
<!--add a couple bucks for giftwrap-->

<select name=op3>
  <option value="Large - $4.00">Large</option>
  <option value="Medium - $3.00">Medium</option>
  <option value="Small - $1.50">Small</option>
</select>

Q:
I'm selling yards of carpet, not each of carpet. How do I change my unit of measure?

A:
We offer both a default unit of measure and a line item unit of measure "override" for that "oddball" product. In the cart configuration form, select what you want your normal unit of measure to be. Most choose "ea.". If you need something different for a certain item, you must encode it into the item variable:

<input type=hidden name=item value="a-1358^xyz^item desc^5.00^1^^^yds.">

Note that unit of measure is the eighth field of "item". Even though you did not use field 6 and 7 in the above example you must still maintain the field separators to avoid throwing off the count.

Q:
One of my options lowers the cost. How do I code that?

A:
Just put in a negative value for the cost:

<input type=checkbox name=op2 value="no giftwrap - $-2.00">

Q:
Can I create a single pull down that will effect more than one product variable?

A:
Instead of having the
<select> pull down be an "op" variable modifying the hidden "item" variable, use the item variable itself as the select. That way you can change all fields at once, even making a single pull down to allow an entire list of totally different products to be chosen for adding to the cart. The code would be like this:

<form action=http://www.cartserver.com/sc/cart.cgi method=post>
<select name=item>

<option selected value="a-1234^pn1^1st item descrip^9.99^1^^^^5.2">
the first item</option>

<option value="a-1234^pn2^2nd item descrip^19.99^1^^^^8.2">
the second item</option>

</select>
<input type=image name=add src="anything.gif">
</form>

Q:
I need to allow personalization of an item, and I have three lines of text which can be added. How can that be coded for readability in the cart?

A:
Yes. Separate the text boxes with hidden labels.

<input type=hidden name=op1 value="<br>Line 1:">
<input type=text name=op2>
<input type=hidden name=op3 value="<br>Line 2:">
<input type=text name=op4>
<input type=hidden name=op5 value="<br>Line 3:">
<input type=text name=op6>

Cart display description would be:
Line 1: 1st box text
Line 2: 2nd box text
Line 3: 3rd box text

If number two was left out by customer:
Line 1: 1st box text
Line 2:
Line 3: 3rd box text

It works because the cart counts up when processing op variables, so op1 as "<br>Line 1:" would go in, then it would be followed by the value of op2, which contains the data for line 1.

Here is a complete example. We also add a color choice:

Buy our Address Labels!
<form action=http://www.cartserver.com/sc/cart.cgi method=post>
<input type=hidden name=item value="a-1234^pn^Address Labels^9.99^1">
<input type=hidden name=nodash value=" ">
<input type=hidden name=op1 value="<br>Line 1:">
Line 1: <input type=text name=op2>
<input type=hidden name=op3 value="<br>Line 2:">
Line 2: <input type=text name=op4>
<input type=hidden name=op5 value="<br>Line 3:">
Line 3:<input type=text name=op6>
Choose color:<select name=op7>
<option value="<br>Color: Gold">Gold
<option value="<br>Color: Silver">Silver
</select>
<input type=image name=add src="anything.gif">
</form>

Note 1: Including <br> in a variable value sent to the cart is a special case. It will cause the cart display to drop the description down to the next line for readability, and in the emailed order will map back out to a carriage return.

Note 2: The hidden "nodash" variable being set to a space will cause the cart to NOT use the default dash character as the separator between op values appended to the escription field. Since we are using <br>, having dashes also would not look good.

Q:
I want to use the quote (") symbol in my description, but it messes up the item variable. Is there a workaround?

A:
Use
&quot; instead.

Americart FAQ main page