Product Enquiry Form

DeveloperTutorialsForms

This tutorial will walk through how to create a product enquiry form, which requests basic contact fields and shows a list of products.

Basic Contact Form

The following code is a basic implementation of contact form.

Table of Products

The <ss:data:table> control is used to display products in a table inside the enquiry form. In the example below, the datasource is set to retrieve all products:

\Components\Commerce\Products::getAll()

As an alternative, all Products of a certain Product Category could be retrieved instead by changing the datasource of the <ss:data:table> control:

\Components\Commerce\Products::getAllForCategoryAndBrand($iCategoryId)

The following code will show you how to display a list of products using a data table:

Putting it all Together

Combining the two above example, here is the completed product enquiry form:
  • Product Enquiry Form Code
  • Preview