(Enterprise)

Price equations and constants in price rules

A price equation is a mathematical statement used in a price rule to calculate and output a price. For example, we can create a price equation that adds margins or distribution costs to prices in a price list. We can use the same price equation in more than one price rule so that the set of price rules is easier to maintain.

The following are examples of simple price equations we can create:

To use a price equation to calculate prices on the storefront:

  1. Create the price equation using the graphical equation builder in the Catalog Filter and Pricing tool.

  2. Create a price rule, and then include the price equation in the price rule using the Calculate Price action.

Here is an example: Figure 1. Price equation

In Figure 1:

When Price rule A is assigned to a contract, the price rule calculates the prices customers see on the storefront.


Independent and dependent price equations

We can create two types of price equations, depending on how you plan to reuse the equation:

Dependent price equations are more flexible because we can use them to perform the same calculation on different inputs. For example, in a different price rule, you could use an "Offer" price list instead of the "Cost" price list, but continue to use the "Add Margin" price equation.

A price list is only one means of passing an input price to a dependent price equation. We can use other price rule actions to pass in an input price, such as a Nested Price Rule action or an independent Calculate Price action. Place the action that passes in the price to the left of the Calculate Price action containing the dependent price equation (as shown in Figure 2).


Constants in price equations

A price constant is a number, a percentage, or a price that you intend to use over and over to calculate prices. We can create a price constant, and then use the constant in one or more price equations, or in a Comparison Condition. If you change the value of the constant, our changes automatically apply wherever the constant is used, saving you time. Here are a couple of examples:

The format of a constant can be:

When choosing the format of your constant (Numeric, Percentage, or Currency), think carefully about how we are going to use the constant in your calculation or comparison. Here are a few tips: