When Americart receives a submission, the first thing
it does is look for a variable named "item". That is
where it gets its basic instruction as to what to do.
"item" is a compound variable, meaning that it can
contain more than one discrete piece of data. These
pieces of data are commonly known as "fields".
In its simplest form, the item variable contains
only one field, the "cart-id". In this case, the item
variable looks like any other simple variable:
That single value (field) is enough to tell Americart
what store the submission is coming from, and if we are
just viewing the cart contents without adding anything,
that is all that is required.
Most of the time we are adding things into the cart.
In such cases, Americart needs to know what it is, how
much it costs, etc. To save you space, especially in
large catalogs, we chose to make "item" a compound,
or "field separated" variable.
Consider this scheme which we rejected as too wordy:
We chose to use this format:
As you can see, it is ALOT shorter. The downside to it is
that some people are not familiar with the concept of
"character separated fields". Notice the ^ character between
each piece of data? That character is what Americart uses to
tell where one field stops and the next begins. It goes by count,
and so looks for the item cost to start after the third separator.
You can imagine what might happen if the count was thrown off by
insertion or deletion of one of the ^ characters! Even if you leave
a field empty, you must keep the separators there.
For instance, you don't want to fool with shipping weight.
You empty that field out:
Notice that the ^5.2^ in the first item is now just ^^ ?
All in all, its pretty easy, as long as you keep count.