Shopping Cart Operations > Template Support
Edit Account
(1/1)
HADY:
Hello,
I would like to prevent the client from changing some personal details such Name surname email etc.
How to lock these fields to be read only?
Thanks...
abolabo:
you can do this via hook
--- Code: --- public function onControllerPagesAccountEdit_UpdateData()
{
if (IS_ADMIN == true) {
return;
}
$that = &$this->baseObject;
$form = $that->view->getData('form');
$form['fields']['email']->attr .= ' readonly';
$form['fields']['telephone']->attr .= ' readonly';
$that->view->assign('form', $form);
}
--- End code ---
HADY:
--- Quote from: abolabo on October 01, 2021, 04:35:27 AM ---you can do this via hook
--- Code: --- public function onControllerPagesAccountEdit_UpdateData()
{
if (IS_ADMIN == true) {
return;
}
$that = &$this->baseObject;
$form = $that->view->getData('form');
$form['fields']['email']->attr .= ' readonly';
$form['fields']['telephone']->attr .= ' readonly';
$that->view->assign('form', $form);
}
--- End code ---
--- End quote ---
can you share the file path please ?
Navigation
[0] Message Index
Go to full version