E-Commerce User Guide : Web Rules
 
Web Rules
 
Web Rules:
Enable you to create packages of items for sale via E-Commerce module by auto-selling additional items from a parent item.
Can evaluate age criteria or restrictions of guests attached to the items in the package.
Can be nested to create more complex packages.
 
For a description of how to configure Web Rules to sell pass packages, see E-Commerce pass package functionality.
To implement Web Rules, two fields are used in the items table to facilitate unique actions for item sales via the Web pages: do_on_web and web_rule. These two fields work together and are populated using three text boxes on the SysManager > Activities > DCIs > New/Edit > Web tab: Action to execute when this item is sold on the web, Rule to enforce on a grouping of items created by the Web Rule and Text to display if Web Rule is violated. Typically, Web Rules are used for selling pass packages (e.g., a family pass package consisting of two adult and two children passes) online, but non-pass items can also be “packaged” together for an online sale.
To auto-sell an item after an initial item has been added to the cart, the Action to execute when this item is sold on the web field of the initial item is populated with the macro SELECTITEM("DCI") where DCI is the Department, Category and Item nicknames for the item you want to auto-sell, each padded with spaces if necessary to ten characters (thirty total).
 
Example:
An entry for the Action to execute when this item is sold on the web field:
 
SELECTITEM("PASSES INTPASSES PASSPKGADD")
 
When the item that is configured with this is added to the online shopping cart, it automatically adds the specified item (PASSES INTPASSES PASSPKGADD) to the cart. Items added via this mechanism are linked to the parent item with this action and can only be deleted from the cart by deleting the parent item.
 
Note: if the addition of items via the Web Rule functionality is interrupted before all items and guests associated with these items is completed, no parts of the package is added to the shopping cart and the guest has to start over if they want to purchase the package.
A “bundling rules engine” exists that is designed to enforce an age restriction rule on the guests attached to the items combined by using the SELECTITEM("DCI") action. Currently, only one rule can be configured and only the tally function and age can be used in the rule. The tally function must be followed by an age calculation using standard = <> > < >= <= operators.
 
Example:
A properly configured rule that could get entered into the Rule to enforce on a grouping of items created by the Web Rule field is:
 
tally(age >=18) <= 2
 
In the example above, the tally function counts all of the guests associated with the parent and auto-sold items (those added using SELECTITEM("DCI")) who meet the criteria within the parenthesis, age >= 18. The rule further stipulates that there can only be two or fewer guests, <= 2, whose ages are greater than or equal to 18.
The rule is verified when the final guest is chosen for the additional items. If it fails, the contents of the Text to display if Web Rule is violated field are displayed.
 
Example:
What to populate this field with:
Sorry, but only two guests can be over the age of 18 for the Family Pass Package. Please re-select your guests.
 
Clicking the Continue button on the displayed message box returns the web visitor/guest to the beginning of the guest selection process for the additional items.
Web Rules can be nested, meaning that one item can auto-sell another item, which can auto-sell yet another item, etc. This is accomplished by adding SELECTITEM(DCI) macros to the Web tab for each of the successive items in the package except for the last item.