Shows a Debug box under “Add to cart” button that lets you inspect and debug each detail of your formula.
When your formula is working you will hide debug box.
Important: Debug is shown by default when a parse error is detected (you can not sell a product with parse errors in its formula!)

Syntax

CFO_ShowDebug([MoveUnderDescription], [ShowOriginalFormula]);

MoveUnderDescription: Shows Debug box under description if your formula is too big (optional and by default is false).
ShowOriginalFormula: Shows your original formula or just the resultant values (optional and by default is false).

NOTICE
This function blocks the action of adding the product to the cart in order to let you see the results before that action, and is intended to inspect the formula during development, deactivate debug when ready or read below how to filter by user.

Basic Example

...
//
// And the last line of your formulas during tests, always will be...
CFO_ShowDebug();

Showing debug under description
If debug information is too big or you need to read in a more comfortable way, you can use this parameter and debug box will be shown under description tab of your product. If you are using a custom theme take in consideration that this parameter forces debug to look for a DIV with id=”tab-description”, so you may need to change this in xml file of CFO.

...
//
// Showing debug under description
CFO_ShowDebug(true);

Displaying Debug only for a User
Go to System > Users and locate the user you want to show debug to.
Select desired user, then look at the URL and see user_id={number} use that “number” in the code below.

...
//
// Show Debug only for that user_id
if(CFO_getUserId()==1) {
	CFO_ShowDebug();
}

Take a look at CFO_getUserId function.

You can visit this demo in our Demo Store