Display custom field value to contact?
Is there a way to dynamically display a custom field's value to a logged-in contact?
Context: I use a FCRM custom field to track how many remaining service tasks a client has. These tasks reset each month, and I'd like to display the remaining tasks to the client when they login.
Ideally, I'd LOVE to do this in a Fluent Cart profile section if possible.
Hey Jeffrey YoungΒ , here's a quick snippet you can use for this:
<?php
$contactApi = FluentCrmApi('contacts');
$contact = $contactApi->getCurrentContact($cached = true, $useSecureCookie = true);
$custom_data = '';
if ($contact) {
$custom_fields = $contact->custom_fields();
$custom_data = $custom_fields['arbitrary_field'];
}
?>
Here is your custom field data:
The full details and other contact methods that might be useful are in fCRM docs here.
As far as I'm aware there's no hook available to add things to Fluent Cart profiles yet π You could do a hacky solution with some js, or maybe wait - I imagine there will eventually be a hook available similar to the one allowing you to add custom tabs to fCRM profiles.