Sometimes you need that your formula calculates the final price in different ways given some conditions.
You can use conditionals in your formula although you are not a programmer!!!
Case of study
First identify what to ask to the customer in order to configure the purchase, let’s say we are asking for “Width” and “Height”.
Then idetify the limits of that variables, minumum and maximum values for that values:
Width min=1 and max=3
Height min=1 and max=50
That is very important point because if no limits are set, the customers could configure products that can be produced, so please pay attention when designing that limits.
Try to draw your formula in a paper to see how many conditions will be available to the customer.
Let’s say, for this example, we are going to add an extra cost of 10$ if one of the sizes are greater that 2.
Other condition will be, if square meters is greater than 10 we will apply a discount of 10% and if greater that 15, then 15% of discount over the base price per squaremeters.
Read about PHP Syntax
CFO use PHP syntax so you can use all Conditional Statements, take a look at PHP if…else…elseif Statements and PHP switch Statement
Better to see it in action, so we have prepared a working demo in our demo store.