Now
we add the mandatory tags. they take the form of field name and value of the field name.
Note that in an html link no quotes ( " ) are used within the html link with the
exception of the beginning and the end. Doing so will cause the link to be invalid. That
is, the browser will see the first " after the first " and assume that that is
the end of the string and you will wind up with an invalid syntax window when the cart
tries to open. Now, lets proceed to add the mandatory tags to the link so we can get our
product into the cart (userid, product, price). There is no particular order required but I recommend that you
be consistent with the order throughout all your links. It makes it easier to troubleshoot
if the need should arise.
|
|
Note the ? immediately after
the url. This signifies the end of the address and the start of the product information to
be passed to the cart.. To look at it in English, it reads "the user identification
is 1234567 and the product is a little red wagon and the price of the little red wagon is
29.95". Since no spaces are allowed in an html string we use the + sign to add
a space when needed. Without the + sign it would look like LittleRedWagon in the cart.
Note also that the $ sign is not used and the & symbol is mandatory
to link the name and value pairs together so don't use it in your product description or
you'll get a syntax error..
Now, let's add our "Buy Now" button |
Buy Now
|
| Note that a + sign is not required between Buy and Now
as it is outside of the html string. Note also that we haven't included the qty field as
the default is 1. If we sold our product with a minimum quantity of 5, we could insert the
field like so. |
Buy Now
|
If you click on the link below,
please set the quantity to "0" in the cart and recalculate before you close the
window
Buy Now
|
|
| Just about done |
| So, now lets add our return link as we do
want the to provide the customer with an easy way to buy some more of our products without
having to find us all over again. The field follows the convention return=www.yourdomain.com/yourpage.html
Now add it all together:
|
<a href="http://www.aitsafe.com/cf/add.cfm?userid=1234567
&product=Little+Red+Wagon&price=29.95
&return=www.yourdomain.com/yourpage.html">
|
The above lines would normally be one
continuous line, but I've inserted a line break to avoid having to scroll horizontally.
Now you know all you need to know to add a Buy Now button to your products. It wasn't all
that hard now, was it? |
|