Author Topic: Edit Account  (Read 4141 times)

Offline HADY

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +27/-5
    • View Profile
Edit Account
« on: September 30, 2021, 10:08:12 AM »
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...
 
Thank you In Advanced
Regards
HADY

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Edit Account
« Reply #1 on: October 01, 2021, 04:35:27 AM »
you can do this via hook

Code: [Select]
    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);
    }
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline HADY

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +27/-5
    • View Profile
Re: Edit Account
« Reply #2 on: October 01, 2021, 06:23:31 AM »
you can do this via hook

Code: [Select]
    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);
    }


can you share the file path please ?
Thank you In Advanced
Regards
HADY

 

Powered by SMFPacks Social Login Mod