Dynamic price calculation that is not visible
In this section we are going to show how to create a price calculation that is not visible to users of the configuration. This can be useful if you don't want to show vendors or customers how the price is constructed. In addition, in this section we will use a Calculated Value to dynamically calculate the price.
Price for the tires
By default the Roadmaster 100 has 4 tires, if the length of the cargo area is 6000mm or more then the truck has double tires at the back to carry the weight.
This price calculation we want to do a under its own 'heading'.
-
Create a new Feature called Price Calculation, give it relationship type Mandatory.
-
Under Price calculation, create a Feature called Number of tires, this also has a relationship type Mandatory.
Calculating the number of tires
We calculate the number of tires on the Feature Number of tires with a Calculated Value. In the Calculated Value we use an if formula. An if formula consists of 3 parts, the condition, the outcome if the condition is true, the outcome if the condition is false.
We write an if formula within Elfsquad CPQ in the following way;
iif(condition, true, false).
For the condition we want to check if the length of the cargo hold is greater than or equal to 6000mm, if true then the result is 6, if false then the result is 4.
-
Open the Constraint Calculated Value for the Feature Number of tires.
-
Create a new variable.
-
In the window that now opens select the Feature Length.
-
In the formula field, type the following formula: iif(@Length >= 6000, 6, 4)
In the condition of this if formula we check if the feature Length has a Quantity that is greater or equal to 6000. If this condition is true, then the Quantity of the feature Number tire becomes 6, if it is not true then the Quantity becomes 4.
Now go back to the preview of the model. If you scroll down you will see the Feature Number of Tires with a Quantity of 4. Change the length of the cargo hold to 6000mm and now look again at the Feature Number of Tires, it now has a value of 6.
Tire features
In our model we have a choice of 2 tires, for both tires we want to create a new Feature under the Price calculation.
-
Under Price calculation create the Feature Price tire 1, give it relationship type Mandatory.
-
Give the Feature Price tire 1 a price of €154.
-
In the same way, create a Feature called Price tire 2, with a price of €178.
Both Features are now on by default, but we want only Price tire1 to be visible if tire 1 is chosen and Price tire 2 to be visible if tire 2 is chosen. We will do this with the Constraint Condition.
-
Open the Condition for Price tire 1.
-
Add a new variable.
-
In the window, select the Feature tire 1.
-
In the formula field, type the following formula; @tire1 <> 0.
-
Repeat the above steps also for Price tire 2, but with the Feature tire 2.
-
The formula @tire 1 <> 0 verifies that the tire 1 selection is on.
Go to the Preview. If you scroll all the way down again you will see only the Feature Price tire 1. If you make the selection for tire 2, you will see the Feature Price tire 2 at the bottom.
Now we have to combine the number of tires with the price of a tire. The easiest way to do this is to set the value of the Features Price tire 1 & 2 to be equal to the Quantity of the Feature Number of tires. This is easy to set up.
-
Click on the Calculated Value for Price tire 1.
-
Add a new variable.
-
In the list, find the Feature Number of tires and select it.
-
In the formula field, type only the variable now.
-
Repeat these steps for Price tire 2 as well.
If we now look at the Preview we see the Feature Price tire 1, where the price is calculated €154 times 4. Now change the length of the Roadmaster 100 to 6000mm. If you now look at the Feature Price tire 1 again you will see that the price of the Feature is now calculated with the value of 6. This also works for the selection of tire 2.
Making price calculation invisible
We mentioned earlier that the user of the Configurator should not see how we make the price calculation, this is very easy to do. For the Features Number of tires, Price tire 1 and Price tire 2 you want to set the visibility to 'Hide in Order Entry', you do this by clicking on the cog icon behind each Feature.
If we now go back to the Preview we will see the result of the calculation appear on the Feature Price Calculation. This Feature has taken over the value of the underlying Features.
It is also possible to make the Price Calculation Feature invisible in the Order Entry. Then we no longer see the result of our price calculation, but the result is still added to the total price.
Opmerkingen
0 opmerkingen
U moet u aanmelden om een opmerking te plaatsen.