Difference between revisions of "Order Express Pricing Rules"

From eVision
Jump to: navigation, search
(Some)
m
 
(17 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Overview ==
+
Test
 
+
[[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 <code>PricingRules</code> table.  Rules are written in [[wikipedia:Reverse Polish Notation|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.
+
 
+
* <code>C:</code> - Category
+
* <code>COUNT:</code> - Count
+
* <code>E:</code> - Finished End Option Group
+
* <code>EVALUATION:</code> - Evaluation
+
* <code>EVERY:</code> - Every
+
* <code>H:</code> - Hinging Option Group
+
* <code>LIMIT:</code> - LIMIT
+
* <code>N:</code> - Style Option Selections Count
+
* <code>L:</code> - Product Line
+
* <code>Q:</code> - Style Option Selection
+
* <code>S:</code> - Style Category
+
* <code>SOME:</code> - Some
+
 
+
== 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.
+
 
+
* <code>A:</code> - [[#Specials|Special]]
+
* <code>D:</code> - [[#Modifications|Modification]]
+
* <code>F:</code> - [[#Nested_Formulas|Formula]]
+
* <code>I:</code>, <code>=></code>, and <code>,</code> - [[#Conditional_Expressions|Conditional]]
+
* <code>M:</code> - [[#Variable_Price_Codes|Variable Price Code]]
+
* <code>O:</code> - [[#Style_Options|Style Option]]
+
* <code>P:</code> - [[#Products|Product]]
+
* <code>R:</code> - [[#Prices|Price]]
+
* <code>T:</code> - [[#Tags|Tag]]
+
* <code>U:</code> - [[#Upcharges|Upcharge]]
+
* <code>V:</code> - [[#Variables|Variable]]
+
* <code>W:</code> - [[#Modification_Variables|Modification Variable]]
+
* <code>X:</code> - [[#Constants|Constant]]
+
 
+
== Usage ==
+
 
+
=== Specials ===
+
 
+
Tokens: <code>A:</code>
+
 
+
Format: <code>A:?</code>
+
 
+
The format <code>A:?</code> is the equivalent of asking if the current item being evaluated is a special (product).
+
 
+
=== Categories ===
+
 
+
Tokens: <code>C:</code>
+
 
+
Format: <code>C:[product_category_display_id]</code> or <code>C:[modification_category_display_id]</code>
+
 
+
The value for the <code>[product_category_display_id]</code> parameter should match the <code>ProductCategoryDisplayID</code> in the <code>ProductCategories</code> table. The value for the <code>[modification_category_display_id]</code> parameter should match the <code>ModificationCategoryDisplayID</code> in the <code>ModificationCategories</code> table.
+
 
+
=== Count ===
+
 
+
Tokens: <code>COUNT:</code>, <code>(</code>, <code>,</code>, <code>)</code>
+
 
+
Format: <code>COUNT:([atoms])</code> or <code>COUNT:[count_greater_or_equal_to]([atoms])</code>
+
 
+
The value for <code>[atoms]</code> is a comma separated list of atoms to test against. Returns the number <code>[atoms]</code> that return true. The value of <code>[count_greater_or_equal_to]</code> changes the return type of this atom into a boolean, where the result is true if the number of <code>[atoms]</code> is greater or equal to the value supplied.
+
 
+
=== Modifications ===
+
 
+
Tokens: <code>D:</code>
+
 
+
Format: <code>D:[modification_display_id]</code> or <code>D:?</code>
+
 
+
The value for the <code>[modification_display_id]</code> parameter should match the <code>ModificationDisplayID</code> in the <code>Modifications</code> 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 <code>D:?</code> is the equivalent of asking if the current item being evaluated is a modification.
+
 
+
=== Every ===
+
 
+
Tokens: <code>EVERY:</code> or <code>ALL:</code>, <code>(</code>, <code>,</code>, <code>)</code>
+
 
+
Format: <code>EVERY:([atoms])</code>
+
 
+
The value for <code>[atoms]</code> is a comma separated list of atoms to test against. Returns true if all of the atoms test true.
+
 
+
=== Nested Formulas ===
+
 
+
Tokens: <code>F:</code>
+
 
+
Format: <code>F:[parameter]</code>
+
 
+
Executes the pricing rule with a name of <code>[parameter]</code>.  This is primarily used in conjunction with the conditional operators, or to split expressions into shorter pieces.
+
 
+
The value for <code>[parameter]</code> should match <code>PricingRuleLabel</code>.
+
 
+
=== Conditional Expressions ===
+
 
+
Tokens: <code>I:</code>, <code>=></code>, <code>,</code>
+
 
+
Format: <code>I:[conditional]=>[expression_if_true],[expression_if_false]</code>
+
 
+
Conditional expressions are defined using the above tokens.  When these tokens are found within the expression, the expression is split into multiple ''parts''.  The <code>[conditional]</code> parameter is ''always'' executed to determine if it evaluates to a <code>true</code> or <code>false</code> value.  If this evaluates to <code>true</code>, the <code>[expression_if_true]</code> parameter is executed.  If it evaluates to <code>false</code>, the <code>[expression_if_false]</code> parameter is executed.
+
 
+
=== Limits ===
+
 
+
Tokens: <code>LIMIT:</code>, <code>(</code>, <code>,</code>, <code>)</code>
+
 
+
Format: <code>LIMIT:([atoms])</code> or <code>LIMIT:[maximum]([atoms])</code>
+
 
+
The value for <code>[atoms]</code> is a comma separated list of atoms to test against. The value of <code>[maximum]</code> indicates the threshold at which the result will be true (greater than <code>[maximum]</code>). If no <code>[maximum]</code> is supplied, it is assumed <code>0</code>.
+
 
+
=== Style Options ===
+
 
+
Tokens: <code>O:</code>
+
 
+
Format: <code>O:[style_option_display_id]</code> or <code>O:[style_option_tag_name]</code>
+
 
+
The value for the <code>[style_option_display_id]</code> parameter should match the <code>StyleOptionDisplayID</code> in the <code>StyleOptions</code> table. The value of <code>[style_option_tag_name]</code> should match the <code>StyleOptionTag</code> in the <code>StyleOptionTags</code> table.
+
 
+
=== Products ===
+
 
+
Tokens: <code>P:</code>
+
 
+
Format: <code>P:[product_display_id]</code>, <code>P:[product_id]</code> or <code>P:?</code>
+
 
+
The value for the <code>[product_display_id]</code> parameter should match the <code>ProductDisplayID</code> in the <code>Products</code> table. Similarly, if <code>[product_id]</code> is used, it should match the <code>ProductID</code>. The format <code>P:?</code> is the equivalent of asking if the current item being evaluated is a product.
+
 
+
=== Variable Price Codes ===
+
 
+
Tokens: <code>M:</code>
+
 
+
Format: <code>M:[variable_code]</code>
+
 
+
Used to obtain the price for the current item.  The value specified for the <code>[variable_code]</code> parameter is used, alongside the current price group, to obtain the price for the current item.  The value for the <code>[variable_code]</code> parameter must match the <code>Code</code> column in the  <code>OEVariablePriceCodes</code> table.
+
 
+
=== Style Option Selections ===
+
 
+
Tokens: <code>Q:</code>
+
 
+
Format: <code>Q:[style_option_display_id]</code> or <code>Q:[style_option_tag_name]</code>
+
 
+
The value for the <code>[style_option_display_id]</code> parameter should match the <code>StyleOptionDisplayID</code> in the <code>StyleOptions</code> table. The value of <code>[style_option_tag_name]</code> should match the <code>StyleOptionTag</code> in the <code>StyleOptionTags</code> table.
+
 
+
=== Prices ===
+
 
+
Tokens: <code>R:</code>
+
 
+
Format: <code>R:[price_type]</code> or <code>R:[pricing_rule_label]</code>
+
 
+
Used to obtain the price for the current item. Only four values are valid for the <code>[price_type]</code> parameter. These values are <code>BOOK</code>, <code>LIST</code>, <code>PREMIUM</code> or <code>BASE</code>. If <code>[pricing_rule_label]</code> is supplied, it executes the pricing rule with a name of <code>[pricing_rule_label]</code>. The value for <code>[pricing_rule_label]</code> should match <code>PricingRuleLabel</code>.
+
 
+
=== Some ===
+
 
+
Tokens: <code>SOME:</code> or <code>ANY:</code>, <code>(</code>, <code>,</code>, <code>)</code>
+
 
+
Format: <code>SOME:([atoms])</code>
+
 
+
The value for <code>[atoms]</code> is a comma separated list of atoms to test against. Returns true if any of the atoms test true.
+
 
+
=== Tags ===
+
 
+
Tokens: <code>T:</code>
+
 
+
Format: <code>T:[tag_name]</code>
+
 
+
Used to determine if the current item is tagged as the value specified in the <code>[tag_name]</code> parameter.
+
 
+
=== Upcharges ===
+
 
+
Tokens: <code>U:</code>
+
 
+
Format: <code>U:[style_option_category_short_name]</code>
+
 
+
Used to obtain the price of an upcharge for the style option category that matches the <code>[style_option_category_short_name]</code> parameter for the current item.  The value for the <code>[style_option_category_short_name]</code> must match the <code>ShortName</code> column in the <code>StyleOptionCategories</code> table.
+
 
+
=== Variables ===
+
 
+
Tokens: <code>V:</code>
+
 
+
Format: <code>V:[variable_code]</code>
+
 
+
Used to obtain the value of a product variable for the current item.  The value for the <code>[variable_code]</code> parameter must match the <code>VariableCode</code> column in the <code>OEVariables</code> table.
+
 
+
=== Modification Variables ===
+
 
+
Tokens: <code>W:</code>
+
 
+
Format: <code>W:[variable_code]</code>
+
 
+
Used to obtain the value of a modification variable for the current item.  The value for the <code>[variable_code]</code> parameter must match the <code>VariableCode</code> column in the <code>OEVariables</code> table.
+
 
+
=== Constants ===
+
 
+
Tokens: <code>X:</code>
+
 
+
Format: <code>X:[constant_name]</code>, <code>X:[decimal]</code>, <code>[decimal]</code>, <code>"[string]"</code> or <code>[boolean]</code>
+
 
+
Used to obtain the value of constant.  The value for the <code>[constant_name]</code> parameter must match the <code>ShortName</code> column in the <code>Constants</code> table. If <code>[decimal]</code> is used, the value must be a string representation of a number. <code>[string]</code> can be any valid string, wrapped in double quotes. <code>[boolean]</code> can be <code>true</code> or <code>false</code>.
+

Latest revision as of 16:05, 29 June 2016

Test