We get a lot of questions about how to add to the cart programmatically, via a link, or button, etc. The syntax is very simple. Just link to:
addtocart.aspx?productid=M&variantid=N
That is the absolute minimum syntax
The next most common syntax is:
addtocart.aspx?productid=M&variantid=N&quantity=Q
the full syntax could be:
addtocart.aspx?ProductID=M&VariantID=N&Quantity=Q& ReturnURL=whatever.aspx&price=x.xx&Color=red&Size= L&ShippingAddressID=R
price is for forcing price in (note this may not be honored for all product types, e.g. kits).
if ProductID is not specified, it will be determined from the VariantID
If VariantID is 0 or not specified, nothing will get added
Size and Color values MUST be in master web.config locale value form (for multi-lingual sites, and properly URL encoded)
ReturnURL must be properly URL encoded
Quantity defaults to 1 if not specified