Custom Product Templates: Ordering Options

Product ordering options allow merchants to display product sizes, colors, etc. for customers to choose from. Including them in your product template is relatively simple because there aren't many custom template tags that you need to work with.

  • The easiest way to display ordering options for a product -- along with the surrounding <form> tags -- is to use the [-- PRODUCT.OrderCheckout --] tag. See Example 4 on the Custom Product Templates: Product Buttons page.
  • If you don't use the [-- PRODUCT.OrderCheckout --] tag, your template must contain HTML form tags for the ordering options and a form submit button for the Add to Cart button.
  • Your template should test whether ordering options are enabled for a product.

Example 1: Ordering Options
This example shows how to test whether ordering options are enabled for a product. If they are, the example uses an HTML form to display the ordering options and an Add to Cart button. If not, it just displays a simple Add to Cart button.

Product Name

[-- IF PRODUCT.DisplayOrderingOptions --]
<form action="[-- SHOPPING_CART_URL Base --]/order.cgi" method="post">
<input type="hidden" name="storeid" value="[-- STORE.ID --]">
<input type="hidden" name="dbname" value="products">
<input type="hidden" name="function" value="add">
[-- PRODUCT.OptionText --]
[-- Order_Option_Menu Line --]
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
<input type="submit" value="[-- PRODUCT.AddToCartButton --]">
</form>
[-- ELSE --]
<a href="[-- PRODUCT.AddToCartURL --]">Add to Cart</a>
[-- END_IF --]


Example 2: Ordering Options In A Column
You can change Line to Column to display the ordering option pull down menus in a single column rather than in a line.

Product Name

[-- IF PRODUCT.DisplayOrderingOptions --]
<form action="[-- SHOPPING_CART_URL Base --]/order.cgi" method="post">
<input type="hidden" name="storeid" value="[-- STORE.ID --]">
<input type="hidden" name="dbname" value="products">
<input type="hidden" name="function" value="add">
[-- PRODUCT.OptionText --]
[-- Order_Option_Menu Column --]
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
<input type="submit" value="[-- PRODUCT.AddToCartButton --]">
</form>
[-- ELSE --]
<a href="[-- PRODUCT.AddToCartURL --]">Add to Cart</a>
[-- END_IF --]

Return To: Product Template Home Page