SWS Order System
SWS Order System
SWS Order System

SWS Order System

This was undoubtedly the most complex project I’ve worked on, an order system for garage doors and security shutters. Each step of the order process is based on the preceding steps, for example a certain width will make it impossible to have a manually operated door.

Each product is stored as what can only be described as a supermassive array of arrays, containing every step and field for the product. Conditions for each field are stored in the array, as well as validation. The same condition and validation information is stored for each option of each field. There are also conditional notes which can be shown to alert the user to surcharges, suggestions or other information.

The supermassive arrays are used by form generation functions that add each field and option to the step, based on the conditions in the array. For example, the ‘Bi-parting’ option is only available when the width is greater than 999:

array('name' => 'Bi-parting', 'condition' => array(array('field' => 'Width', 'rule' => '>', 'value' => 999))),

Many different conditions and types of condition can be added, so almost any complexity can be handled. Conditions can be set for previous steps and validated via PHP, or in the current step and checked via Javascript.

The system also adds JavaScript validation to the page as well as validating submitted forms server-side. It was very challenging and time consuming catering for each type of field and it’s validation, but the end result was definitely worth it. When a new product is added to the site you simply need to create a new product logic array, there’s no need to amend the system itself.

The rest of the system is pretty standard, orders can be created and amended, adding, removing and editing products to each order. Orders can then be sent for processing, which staff then pick up in their area of the system.

Leave a Comment