less than a minute read • Updated 20 minutes ago
Add multiple products to the cart at once
How to add multiple products to the cart in a single click.
You can add multiple products to the cart in a single link or form without using a parent/child relationship. Each product is independent — customers can remove or adjust quantities on each item individually. Use this for accessories or ensemble items that are conveniently added together but are otherwise separate.
How to set it up
Use integer prefixes (1:, 2:, 3:, etc.) to separate each product in a single form:
<form action="https://YOURSUBDOMAIN.foxycart.com/cart" method="post">
<input type="hidden" name="name" value="Fancy Smartphone" />
<input type="hidden" name="price" value="199.99" />
<input type="hidden" name="2:name" value="Leather Case" />
<input type="hidden" name="2:price" value="9.99" />
<input type="submit" value="Add both to cart" />
</form>
The same can be done with a link:
https://YOURSUBDOMAIN.foxycart.com/cart?name=Fancy+Smartphone&price=199.99&2:name=Leather+Case&2:price=9.99
Notes
All required parameters (
name,price) are required for each product.Products added this way are fully independent — customers can remove or adjust quantities on each item without affecting the others.
If you want products to be linked so that deleting one deletes the other, use a bundled product instead — see Create a bundled product.
Integer prefixes support values from
1to999. If no prefix is used, the product is assumed to be1:.