Customers / Users attributes and extra fields

Customers / Users attributes and extra fields

In version 3.9 of DJ-Catalog2, we have introduced a system that allows you to control customer attributes more flexibly and also create custom fields.
You will find core attributes that had already been present in previous versions, which are usually needed to create user profiles or conduct purchases, for example, address, phone, email. Those fields are created by default and should rather not be removed from the system. There is also the possibility to add your own fields and you can select from the following types:
  1. Text - single-line text field
  2. Textarea - multi-line text field
  3. Calendar / Date - date picker
  4. Select - drop-down list
  5. Radio - single choice list of radio buttons
  6. Checkbox - multiple-choice list of checkboxes
  7. Boolean - checkbox [true/false]
  8. File upload 
  9. HTML
  10. Spacer - more information
  11. Note - more information



As you can see you can also select in which predefined set of form fields should the attribute appear. You can choose from:
  1. Basic / Billing details
  2. Statements and Agreements
And finally, you can make the field optional, required, or hidden per each of the available forms, that is:
  1. User registration (standard Joomla! registration page), the following plugin has to be enabled: User - DJ-Catalog2,
  2. User profile edit form (standard Joomla! user profile page), the following plugin has to be enabled: User - DJ-Catalog2,
  3. Checkout - when customer user makes a new order,
  4. Query - when a customer inquires about products in the cart.
Important: Because of the backward compatibility that had to be maintained, the default fields use the labels that can be translated in the language file or language overrides. This is why you might notice field labels such as COM_DJCATALOG2_UP_FIRSTNAME instead of "First name" or COM_DJCATALOG2_UP_ADDRESS instead of "Address".
Customization required: depending on your Joomla! version or layout overrides that are created in your template, you might need to create an override of the following layout file:
/components/com_users/views/profile/tmpl/edit.php
If you haven't created an override for that file, please copy it to your template directory, to the following path:
/templates/[your-template]/html/com_users/profile/edit.php
Then replace the following contents (lines no. 72-88)
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type !== 'Spacer') : ?>
<span class="optional">
<?php echo JText::_('COM_USERS_OPTIONAL'); ?>
</span>
<?php endif; ?>
</div>
<div class="controls">
<?php if ($field->fieldname === 'password1') : ?>
<?php // Disables autocomplete ?>
<input type="password" style="display:none">
<?php endif; ?>
<?php echo $field->input; ?>
</div>
</div>
with:
<?php if ($field->fieldname === 'password1') : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type !== 'Spacer') : ?>
<span class="optional">
<?php echo JText::_('COM_USERS_OPTIONAL'); ?>
</span>
<?php endif; ?>
</div>
<div class="controls">
<?php if ($field->fieldname === 'password1') : ?>
<?php // Disables autocomplete ?>
<input type="password" style="display:none">
<?php endif; ?>
<?php echo $field->input; ?>
</div>
</div>
<?php else :?>
<?php echo $field->renderField();?>
<?php endif; ?>
You can also download a pre-customized file below.

      • Related Articles

      • "Show on click" for fields displayed in users profile on adverts details page

        Now you can set the option “Show on click” also for fields in a user profile. Once you edit the custom fields, you can select "Show on click" in the checkbox and after that this field's details will be revealed after a click. Setting To set it to go ...
      • Extra/Custom fields in DJ-Classifieds

        The DJ-Classifieds component allows assigning additional fields to the advert details from a certain category. Settings To create a custom field, click on the Extra Fields button from the Control Panel, then click New from the top right toolbar, and ...
      • How to add custom fields to user profile in DJ-Classifieds

        This step by step tutorial shows how to add extra fields to DJ-Classifieds User's Profile. You can find the other tutorial explaining how to allow user's pictures in profiles here . STEP#1. Open Extra Fields in DJ-Classifieds Component STEP#2. Create ...
      • Remember user's details when submitting new advert

        This is a real time saver for users! The administrator can connect user profile fields with Category and Contact fields. This way, fields will be autocompleted with data that do not need to be entered each time users submit ads. So, in other words: ...
      • Conditional Fields DJ-Classifieds App

        The principle of conditional fields is simple - when editing a custom field, you can specify a dependency when that field is displayed. The chosen custom field will appear only if a specific value is selected in another custom field.  Conditional ...