Table of Contents

Product Categories

What Product Categories Are

Categories offer a way to give products additional behaviors that cannot be accomplished by product options alone. While it's probably best to take a look at the category settings in your admin, we'll briefly discuss the functionality that categories offer.

How Product Categories Work

Using product categories is fairly straightforward if you already understand how FoxyCart's products function. Simply:

  1. Create a category in your store's admin.
  2. Assign that category to the product in your add-to-cart link or form, where the “category code” (as configured in the admin) is set in the product's category option. So, something like this:
    <a href="https://YOURDOMAIN.foxycart.com/cart?name=A great product&price=5&category=YOUR_CATEGORY_CODE">
    	Buy this Great Product!
    </a>
    <form action="https://YOURDOMAIN.foxycart.com/cart" method="post">
    	<input type="hidden" name="name" value="A great product" />
    	<input type="hidden" name="price" value="5.00" />
    	<input type="hidden" name="category" value="YOUR_CATEGORY_CODE" />
    	<select name="size">
    		<option value="small">Small</option>
    		<option value="medium">Medium</option>
    		<option value="large">Large</option>
    	</select>
    	<input type="submit" value="Buy It Now!" />
    </form>

The Default Category

You'll notice that the category product parameter is optional. If you don't specify a category, the DEFAULT category will be used.

Creating New Categories

It may not be immediately evident, but if you use the select box at the top of your Category page (in the “Select a Category” fieldset) in your store's admin you'll see an option to add a new category. Doing so will actually make a copy of the category you're currently editing. Prior to seeing the option to add a new category in the “Select a Category” fieldset, you'll have to create the Default category by assigning a Product Delivery Option and clicking on the Create Category: DEFAULT button at the bottom of the page.