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.
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.
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.
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>