A Naming Rule allows a configurator to change the name and description of its configured product based on Snap logic. Naming rules are useful in case you want to be more descriptive in how the product displays in the quote, since by default the name and description are simply the name and description of the configurator as it appears on the product page. Adding more contextual information may help convey the type of configured product that is being quoted.
- This rule is run on the server-side. Since this rule is run on the server, and not locally, you can tap into a broader set of information to determine the name of the configuration. For example, you can lookup to a database table, a web service, or other resources to generate the product name.
- This rule runs after the user submits their configured product.
Arguments
Arguments are variables passed in to the rule. You can find them by using the Get/Set variable snap blocks. In this rule type, the Get block exposes these arguments:
Name | Type | Description |
---|---|---|
configurator | Configurator | the current running configurator. |
quote | Quote | The quote this configured product belongs to. Important: The naming rule is also run before the product is added to a quote, so this value may be null. |
environment | string | "dev" if you are in the development environment, "test" if you are in the test environment, and "prod" if you are in the production environment. |
Example 1: simple name update
Example 2: smart part number
Your product may have a "smart part number", where various digits of the part number are related to product options. Use a naming rule to re-calculate the part number with every selection your user makes. The following example combines static text, field data, and a table/database query to generate a part number.
Snap rules run in a specific order, and in response to specific events. Learn more about rule execution order.