<?php

// Show product custom fields.
if (isset($service->ProductCustomFields) && !empty($service->ProductCustomFields)) {
    foreach ($service->ProductCustomFields as $custom_field) {
        if ($custom_field['ShowClientArea'] == 'yes' && isset($service->ProductInformation['Custom'][$custom_field['FieldCode']]) && !empty($service->ProductInformation['Custom'][$custom_field['FieldCode']])) {
            ?>
            <dt class="col-sm-4"><?php echo normalize($custom_field['LabelTitle']); ?></dt>
            <dd class="col-sm-8"><?php echo isset($service->ProductInformation['Custom'][$custom_field['FieldCode']]) ? formatCustomFieldValue($custom_field, $service->ProductInformation['Custom'][$custom_field['FieldCode']]) : ''; ?></dd>
            <?php
        }
    }
}

// Show service custom fields.
if (isset($service->ServiceCustomFields) && !empty($service->ServiceCustomFields)) {
    foreach ($service->ServiceCustomFields as $custom_field) {
        if ($custom_field['ShowClientArea'] == 'yes' && isset($service->Custom[$custom_field['FieldCode']]) && !empty($service->Custom[$custom_field['FieldCode']])) {
            ?>
            <dt class="col-sm-4"><?php echo normalize($custom_field['LabelTitle']); ?></dt>
            <dd class="col-sm-8"><?php echo isset($service->Custom[$custom_field['FieldCode']]) ? formatCustomFieldValue($custom_field, $service->Custom[$custom_field['FieldCode']]) : ''; ?></dd>
            <?php
        }
    }
}