Basic Add to Cart Links and Buttons
This page explains the basics of Add to Cart links and buttons. Please read this page before creating any links or buttons.
Before You Start
You can create many types of Add to Cart links or buttons in any style that suits your web site. No need to learn complicated scripting languages, just simple HTML links are all you need. You don't need to know HTML - the HTML here is very straightforward and easy to learn.
When adding links, remember to give each product it's own unique description - no two products on your site should have the same description. You should test each link you create to ensure that you have created the link properly and that the correct product name, price, quantity and price are added the cart correctly and that the pricing remains correct at the order confirmation page and the payment page. Also check that items can be removed from the shopping cart correctly.
Basic Links
The most basic type of links are the text links that say
BUY NOW or
Add to Cart. These simple links can also use an image in place of the text. Simple links take the following forms:
Link Type | HTML Code |
BUY NOW | <a href="http://www.fastcart.co.uk/cart/index.php?id=1223&item=Big+Blue+Widget&price=9.99" target="_top"> BUY NOW </a> |
The simple HTML link above is probably the easiest link to use.
|
| <a href="http://www.fastcart.co.uk/cart/index.php?id=1223&item=Big+Blue+Widget&price=9.99" target="_top"> <img src="addtocart.gif" border="0"> </a> |
This image link is the same as the simple HTML link except that it uses an Add to Cart image in place of the BUY NOW text. Remember to set the border to 0 or you will get a blue line around the image.
|
The individual parts of the link are as follows:
<a href="http://www.fastcart.co.uk/cart/index.php? | This is the beginning of the link to the cart with the full URL of the cart (index.php). The ? on the end is important. |
id=1223&item=Big+Blue+Widget&price=9.99" | These are key=value pairs. The keys are id, item and price. Each key=value pair must be separated by an ampersand (&). See below for details of each key=value pair you can use. |
target="_top" | This ensures that when someone clicks the Add to Cart button, all content in the browser (including all frames) is replaced by FastCart. |
>BUY NOW</a> | This completes the link with the text "BUY NOW". You can use any text you like, such as "Add to Cart" and so on. You can also use images in place of the text. |
Key = Value Pairs
The following keys are just some of those available. Some keys are required in every link. You can place the key=value pairs in any order you like, providing that you place an ampersand (&) between each one:
Key | Usage | Explanation |
id | id=1223 | This is your unique user ID for FastCart. This is required in every link and every link must contain exactly the same id. If you omit this, your shoppers will receive an error. |
item | item=Big+Blue+Widget | This is the name of the product and is required in every link. You should ensure that you give every product it's own unique name. Avoid using symbols such as quotes, apostrophes, colons, semi-colons etc. Use the + symbol instead of spaces or the link won't work. For items that come in various sizes or colours etc, give each one it's own unique name, ie: Shirt+Large+Blue Shirt+X-Large+Green |
price | price=9.99 | This is the price in the default currency for your account and is required in every link. You should enter only the numeric value and the default currency symbol will be displayed in the cart. |
qty | qty=1 | This is the quantity and is optional in your links. If omitted from a link, FastCart will assume a quantity of 1. |
weight | weight=350 | Weight is only used with weight based shipping. Remember to use the same weights scales as you have set in the control panel - do not mix grams and kilograms. If weight is omitted, FastCart will assume a weight of zero. |
returnurl | returnurl= http://www.fastcart.co.uk/page3.html | This is optional. You can specify which page shoppers should return to when they click the Back to Store button in FastCart. If you do not enter a return URL, the default return URL (which is set in the control panel) will be used instead. |