PMSToys:
Is it possible to restrict customers from changing certain details in their account?
Yes. It is possible to prevent customers from editing certain details in their account through edits. For example, my ZenCart doesn't allow customers to change their birthdays.
You would need to edit your templates tpl_account_edit_default.php file.
For example. To block the customer from changing their name:
- Open the tpl_account_edit_default.php file for your template. If one doesn't exist for your template, copy the one from your template_default folder into your template's folder.
- Search for ```html
<label class="inputLabel" for="firstname"><?php echo ENTRY_FIRST_NAME; ?></label>
<?php echo zen_draw_input_field('firstname', $account->fields['customers_firstname'], 'id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<label class="inputLabel" for="lastname"><?php echo ENTRY_LAST_NAME; ?></label>
<?php echo zen_draw_input_field('lastname', $account->fields['customers_lastname'], 'id="lastname"') . (zen_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="alert">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
```
3. Change the above or remove it. Replace it with:```html
<label class="inputLabel" for="firstname"><?php echo ENTRY_FIRST_NAME; ?></label>
<?php echo $account->fields['customers_firstname']; ?>
<?php zen_draw_hidden_field('firstname', $account->fields['customers_firstname'], 'id="firstname"'); ?>
<br class="clearBoth" />
<label class="inputLabel" for="lastname"><?php echo ENTRY_LAST_NAME; ?></label>
<?php echo $account->fields['customers_lastname']; ?>
<?php zen_draw_hidden_field('lastname', $account->fields['customers_lastname'], 'id="lastname"'); ?>
<br class="clearBoth" />
```
Save the file into the appropriate directory. As an advisory, I would recommend detailing to your customer in some capacity they cannot change their name for security reasons.