OrderLink Ordering Method
Previous  Top  Next

The OrderLink method supports the Add to Cart, View Cart, and Check Out functionality within HTML pages. The OrderLink pages can be located anywhere, even on remote servers.

Add to Cart OrderLink Form

When an Add to Cart link is clicked, the product is added to the cart and the shopping cart basket page opens with showing the product(s) and prices.

For each product Add to Cart button, add a form and set the product ID accordingly. The product ID is listed next to each product within the Administration Panel > Edit Products.

Here is an example. The required parameters are quantity, product, and add.

<form method="get" action="http://www.yourdomain.com/ashop/basket.php">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="product" value="1">
<input type="hidden" name="add" value="1">

<input type="submit" name="Submit" value="Add to Cart">
</form>

Note: When a form is inserted inside of a table cell, it can cause unwanted enlargement of the table cell and distort the intended page design. To avoid this problem, put the
<form> and </form> tags between the <tr><td> and the </tr></td> tags.
For example:
<tr><form><td> and </tr></form></td>
This is not specifically WC3 compliant, but it works:-)

For quantity selection, substitute a text box in place of the hidden field.

clip0117

<input type="text" name="quantity" value="18" size="2" maxlength="2">


A drop-down selection box can be substituted for to offer only fixed quantities.

clip0118
<select name="product">
    <option value="1" selected>1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
</select>


Add to Cart OrderLink Hyperlink With Text Or Image
A hyperlink may be used instead of the form.
<a href="http://www.yourdomain.com/ashop/basket.php?quantity=1&product=1&add=1">Add to Cart</a>.
or an image.
<a href="http://www.yourdomain.com/ashop/basket.php?quantity=1&product=1&add=1"><img src="addtocart.gif"></a>.

Change the quantity= and product= parameters accordingly.
The productid is listed next to each product in Edit Catalogue.

clip0045


Single Product Order Link
Omit the add=1 parameter for single product orders. This will clear the basket each time before the product is added.
<href="http://yourdomain.com/ashop/shipping.php?quantity=1&product=1&action=checkout">Buy Now</a>

To go directly to the payment form without viewing the cart.
http://www.yourdomain.com/ashop/shipping.php?quantity=1&product=1&action=checkout
Note that if the product has shipping or taxable set, the shipping information form will appear first.

View Cart Text Link
<href="http://www.yourdomain.com/ashop/basket.php">View Cart</a>

Check Out Text Link 
<href="http://www.yourdomain.com/ashop/shipping.php?action=checkout">Check Out</a>

View Cart Image Link
<http://www.yourdomain.com/ashop/basket.php><img src="viewcart.gif"></a>

Check Out Image Link
<http://www.yourdomain.com/ashop/shipping.php?action=checkout><img src="checkout.gif"></a>

View Cart Form Button
<form method="get" action="http://www.yourdomain.com/ashop/basket.php">
<input type="submit" name="Submit" value="View Cart"></form>
clip0119
Check Out Form Button
<form method="get" action="http://www.yourdomain.com/ashop/shipping.php">
<input type="hidden" name="action" value="checkout">
<input type="submit" name="Submit" value="Check Out"></form>
clip0120