This function blocks the action of adding the product to the cart.
It should be used with some conditions, that way you can avoid adding products to the cart if any condition is not given.



Message: Text that will be shown under “Add to cart” button when the function is executed.


if($Meters<10) {
    CFO_AbortFormula("Minimum meters are 10");
} else {
    $FinalPrice = ...

More samples about server side checkings here

Advanced Styling
You can use those two helpers in order to style the messages shown by CFO_AbortFormula.

$Dummy = CFO_WrapCSSStyle(Message, CSSStyle);
$Dummy = CFO_WrapCSSClass(Message, CSSClass);

Both parameters in both functions are strings.
Take a look at our demo store to see them working, enter a dummy value below 5 to see applying a Style and over 5 to see applying a Class.

You can visit this demo in our Demo Store