less than a minute read • Updated 10 minutes ago
Create a product link
How to create an add to cart link to sell a product using Foxy
An add-to-cart link is the simplest way to sell a product with Foxy. When a customer clicks the link, the product is added to their cart. Links work best for products with no customer-configurable options.
How to set it up
A basic add-to-cart link looks like this:
<a href="https://YOURSUBDOMAIN.foxycart.com/cart?name=Product+Name&price=9.99">Add to cart</a>
Replace YOURSUBDOMAIN with your store’s subdomain, and set name and price to match your product.
Adding more parameters
You can extend the link with additional parameters to pass more product details to Foxy:
<a href="https://YOURSUBDOMAIN.foxycart.com/cart?name=Product+Name&price=9.99&code=SKU123&quantity=1">Add to cart</a>
For a full list of available parameters see Standard parameters reference.
Notes
Links cannot include customer-configurable options such as dropdowns or radio buttons. Use a form instead — see Create a product form.
If you need to secure your links against tampering, see HMAC product verification in the Foxy documentation.
Sample add-to-cart code is available in the Sample Code section of your Foxy admin.
Product parameters are case sensitive.