I’ve got this problem as well. Just migrated from 1.4 to 1.5.9 and trying to solve this. Have read the docs on migrating & changes to custom fields. I have custom fields working in my PDF templates and in email, but am getting errors / no result in the web view templates.
For a custom variable called “ABN” in “user”, I’ve tried:
<?php if ($custom_fields['user']['ABN']) {
echo 'ABN: ' . ($custom_fields['user']['ABN']) . '<br><br>'; } ?>
Which throws up a PHP error: “Undefined variable: custom_fields”
I’ve also tried:
<?php if (!empty($custom_fields['user']['ABN'])): ?>
<?php echo 'ABN: ' . ($custom_fields['user']['ABN']) . '<br><br>'; ?>
<?php endif; ?>
Which doesn’t throw an error, but doesn’t print the custom variable.
What am I doing differently to you @Kovah ?