Jump to content

[SOLVED] Validate Customer display text on AccountForm


PhpMadman

Recommended Posts

Hello.

 

I'm trying to make a module that requiers the user to be validated by an admin before he can log in.

 

Currently i want to add a msg in the account creation page. I found that you should use

 public function hookDisplayCustomerAccountForm() {
  global $smarty;
  $smarty->display(dirname(__FILE__).'/needactivation.tpl');
 }

needactivation.tpl

[size=5]

THIS IS A TEST TEXT[/size]

to add text to that forum. According to the documentation that code should add my text right above the register button. But instead it's added directly to the login / enter mail to reg address.

And it's displayed at the very top of the page. Not under the little boxes.

 

And when I click on Create your account button i also get

TECHNICAL ERROR: unable to load form.
Details:
Error thrown: [object Object]
Text status: parsererror

 

*EDIT*

Using default theme and running 1.5.3.1

Edited by PhpMadman (see edit history)
Link to comment
Share on other sites

Managed to fix it myself, found another code example in the documents.

Changed both install function, file path and hook code.

needactivation.tpl should be in

/views/templates/hook

install code

 public function install()
 {
  return parent::install()
  && $this->registerHook('displayLeftColumn')
  && $this->registerHook('actionCustomerAccountAdd')
  && $this->registerHook('displayCustomerAccountForm') ;
 }

the hook

 public function hookDisplayCustomerAccountForm($params) {
  return $this->display(__FILE__,'needactivation.tpl');
 }

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...