Order Express Pricing Rules
Contents
- 1 Overview
- 2 Unimplemented Keywords
- 3 Implemented Keywords
- 4 Usage
- 4.1 Specials
- 4.2 Categories
- 4.3 Count
- 4.4 Modifications
- 4.5 Every
- 4.6 Nested Formulas
- 4.7 Conditional Expressions
- 4.8 Limits
- 4.9 Style Options
- 4.10 Products
- 4.11 Variable Price Codes
- 4.12 Maximum
- 4.13 Minimum
- 4.14 Style Option Selections
- 4.15 Prices
- 4.16 Some
- 4.17 Summation
- 4.18 Tags
- 4.19 Upcharges
- 4.20 Variables
- 4.21 Modification Variables
- 4.22 Constants
Overview
Order Express utilizes a robust expression system designed by eVision Services which allows for the conditional pricing of items. These pricing rules are stored within the database in the PricingRules table. Rules are written in postfix notation, but includes a number of keywords that can be used to retrieve information about the item being priced (such as how a product can be priced differently based on which styles are applied to it.
Unimplemented Keywords
These keywords are considered to be "valid" keywords/tokens within the Rules Engine but currently have no implementation for pricing rules, and are thus not available for usage in pricing rules.
-
C:- Category -
COUNT:- Count -
E:- Finished End Option Group -
EVERY:- Every -
H:- Hinging Option Group -
LIMIT:- Limit -
MAX:- Maximum -
MIN:- Minimum -
N:- Style Option Selections Count -
L:- Product Line -
Q:- Style Option Selection -
S:- Style Category -
SOME:- Some -
SUM:- Sum -
Z:- Evaluation
Implemented Keywords
The following keywords have a defined meaning within pricing rules and can be used. Each of the keyboards are shown as links which will take you to their usage instructions.
-
A:- Special -
D:- Modification -
F:- Formula -
I:,=>, and,- Conditional -
M:- Variable Price Code -
O:- Style Option -
P:- Product -
R:- Price -
T:- Tag -
U:- Upcharge -
V:- Variable -
W:- Modification Variable -
X:- Constant
Usage
Specials
Tokens: A: or Special:
Format: A:?
The format A:? is the equivalent of asking if the current item being evaluated is a special (product).
Categories
Tokens: C: or Category:
Format: C:[product_category_display_id] or C:[modification_category_display_id]
The value for the [product_category_display_id] parameter should match the ProductCategoryDisplayID in the ProductCategories table. The value for the [modification_category_display_id] parameter should match the ModificationCategoryDisplayID in the ModificationCategories table.
Count
Tokens: COUNT:, (, ,, )
Format: COUNT:([atoms]) or COUNT:[count_greater_or_equal_to]([atoms])
The value for [atoms] is a comma separated list of atoms to test against. Returns the number [atoms] that return true. The value of [count_greater_or_equal_to] changes the return type of this atom into a boolean, where the result is true if the number of [atoms] is greater or equal to the value supplied.
Modifications
Tokens: D: or Modification:
Format: D:[modification_display_id] or D:?
The value for the [modification_display_id] parameter should match the ModificationDisplayID in the Modifications table. If the current item being evaluated is a modification, the value returned will be true if the modification's display id matches. If the current item being evaluated is a product, the value returned will be true if the product has a modification attached to it where the modification's display id matches. The format D:? is the equivalent of asking if the current item being evaluated is a modification.
Every
Tokens: EVERY: or ALL:, (, ,, )
Format: EVERY:([atoms])
The value for [atoms] is a comma separated list of atoms to test against. Returns true if all of the atoms test true.
Nested Formulas
Tokens: F: or Formula:
Format: F:[parameter]
Executes the pricing rule with a name of [parameter]. This is primarily used in conjunction with the conditional operators, or to split expressions into shorter pieces.
The value for [parameter] should match PricingRuleLabel.
Conditional Expressions
Tokens: I: or Conditional:, =>, ,
Format: I:[conditional]=>[expression_if_true],[expression_if_false]
Conditional expressions are defined using the above tokens. When these tokens are found within the expression, the expression is split into multiple parts. The [conditional] parameter is always executed to determine if it evaluates to a true or false value. If this evaluates to true, the [expression_if_true] parameter is executed. If it evaluates to false, the [expression_if_false] parameter is executed.
Limits
Tokens: LIMIT:, (, ,, )
Format: LIMIT:([atoms]) or LIMIT:[maximum]([atoms])
The value for [atoms] is a comma separated list of atoms to test against. The value of [maximum] indicates the threshold at which the result will be true (greater than [maximum]). If no [maximum] is supplied, it is assumed 0.
Style Options
Tokens: O: or StyleOption:
Format: O:[style_option_display_id] or O:[style_option_tag_name]
The value for the [style_option_display_id] parameter should match the StyleOptionDisplayID in the StyleOptions table. The value of [style_option_tag_name] should match the StyleOptionTag in the StyleOptionTags table.
Products
Tokens: P: or Product:
Format: P:[product_display_id] or P:?
The value for the [product_display_id] parameter should match the ProductDisplayID in the Products table. The format P:? is the equivalent of asking if the current item being evaluated is a product.
Variable Price Codes
Tokens: M: or OEVariablePriceCode:
Format: M:[variable_code]
Used to obtain the price for the current item. The value specified for the [variable_code] parameter is used, alongside the current price group, to obtain the price for the current item. The value for the [variable_code] parameter must match the Code column in the OEVariablePriceCodes table.
Maximum
Tokens: MAX:, (, ,, )
Format: MAX:([atoms])
The value for [atoms] is a comma separated list of atoms of which to find the largest value.
Minimum
Tokens: MIN:, (, ,, )
Format: MIN:([atoms])
The value for [atoms] is a comma separated list of atoms of which to find the smallest value.
Style Option Selections
Tokens: Q: or StyleOptionSelection:
Format: Q:[style_option_display_id] or Q:[style_option_tag_name]
The value for the [style_option_display_id] parameter should match the StyleOptionDisplayID in the StyleOptions table. The value of [style_option_tag_name] should match the StyleOptionTag in the StyleOptionTags table.
Prices
Tokens: R: or Price:
Format: R:[price_type] or R:[pricing_rule_label]
Used to obtain the price for the current item. Only four values are valid for the [price_type] parameter. These values are BOOK, LIST, PREMIUM or BASE. If [pricing_rule_label] is supplied, it executes the pricing rule with a name of [pricing_rule_label]. The value for [pricing_rule_label] should match PricingRuleLabel.
Some
Tokens: SOME: or ANY:, (, ,, )
Format: SOME:([atoms])
The value for [atoms] is a comma separated list of atoms to test against. Returns true if any of the atoms test true.
Summation
Tokens: SUM:, (, ,, )
Format: SUM:([atoms])
The value for [atoms] is a comma separated list of atoms to add together.
Tags
Tokens: T: or Tag:
Format: T:[tag_name]
Used to determine if the current item is tagged as the value specified in the [tag_name] parameter.
Upcharges
Tokens: U: or Upcharge:
Format: U:[style_option_category_short_name]
Used to obtain the price of an upcharge for the style option category that matches the [style_option_category_short_name] parameter for the current item. The value for the [style_option_category_short_name] must match the ShortName column in the StyleOptionCategories table.
Variables
Tokens: V: or Variable:
Format: V:[variable_code]
Used to obtain the value of a product variable for the current item. The value for the [variable_code] parameter must match the VariableCode column in the OEVariables table.
Modification Variables
Tokens: W: or ModificationVariable:
Format: W:[variable_code]
Used to obtain the value of a modification variable for the current item. The value for the [variable_code] parameter must match the VariableCode column in the OEVariables table.
Constants
Tokens: X: or Constant:
Format: X:[constant_name], X:[decimal], [decimal], "[string]" or [boolean]
Used to obtain the value of constant. The value for the [constant_name] parameter must match the ShortName column in the Constants table. If [decimal] is used, the value must be a string representation of a number. [string] can be any valid string, wrapped in double quotes. [boolean] can be true or false (case-insensitive).