Syntax
Don’t forget to read this article too: Syntax is a 90% issue

Now don’t forget to activate the formula!
When you add a new product or when you install CFO: all products have their formulas deactivated!
This could be a little obvious but we have a 5% of mails asking that the formula does not work and…

Notice: Undefined variable
Occurs when a variable is used before it was created.
Always is important to initialize your variables at the beginning and be sure that all your conditionals have “else” parts.
Example: Using an uninitialized variable (it will fail)

...
$FinalPrice = $NotCreated;

Example: Initializing variable but then using a wrong name (it will fail)

$VeryGoodInitialized = 10;
...
$FinalPrice = $VryGodInitialied;

Example: Initializing variable into conditionals but not all conditions are covered (it will fail)

...
if($Dummy==1) {
    $RiskVariable = 10;
} elseif($Dummy==2) {
    $RiskVariable = 20;
} elseif($Dummy==3) {
    $RiskVariable = 30;
} elseif($Dummy==4) {
    $RiskVariable = 40;
}
...
$FinalPrice = $RiskVariable;

Example: Initializing variable into conditionals and all conditions covered (it’s ok!)

...
if($Dummy==1) {
    $NoRiskVariable = 10;
} elseif($Dummy==2) {
    $NoRiskVariable = 20;
} elseif($Dummy==3) {
    $NoRiskVariable = 30;
} elseif($Dummy==4) {
    $NoRiskVariable = 40;
} else {
    $NoRiskVariable = 5;
}
...
$FinalPrice = $NoRiskVariable;

You can visit this demo in our Demo Store

Error: Call to undefined function
It’s very common to write a wrong function name, depending on your PHP installation and how it’s configured the error messaging you could get an “Error: Call to undefined function”, an “Internal Server Error” in a message box or even a full blank screen.
In that cases, try to deactivate the formula to ensure it’s the origin, and then review and double check all the syntax in that formula.
Like in this example:

//
// This function do not exists
$FinalPrice = BadWrittenFunction(1);

//
// This other function is misspelled and do not exists too
$FinalPrice = CFOO_Maaaxx(12, 16, 20);

You can visit this demo in our Demo Store

Using Quotes inside Quotes
Some customers have reported us issues with quotes inside quotes, especially in PHP version prior to 5.5.
We have been doing tests and this is our recommendation.
First, use always double quotes, and, if you need to use quotes inside quotes, use them with backslashes:

...
$Dummy = "<span style=\"color: blue;\">Value " . $test . " lower than 10</span>";