ersanserkan Posted April 6, 2012 Share Posted April 6, 2012 Hello, I want to capitalize the customer's first and last name. I know I can use smarty capitalize modifier but I want to automate it while registering. I tried with a hook but I could not succeed. My code was; function hook_capitalize_client_details($vars) { $vars['firstname'] = ucwords($vars['firstname']); $vars['lastname'] = ucwords($vars['lastname']); return $vars; } add_hook("ClientAdd",0,"hook_capitalize_client_details"); Thanks 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted April 6, 2012 Share Posted April 6, 2012 You'd have to update it in the database, the ClientAdd hook doesnt return the $vars back to the function. Its actually ran after the client has already been created. 0 Quote Link to comment Share on other sites More sharing options...
ersanserkan Posted April 6, 2012 Author Share Posted April 6, 2012 Thanks for reply, So is it possible to update the database before system send the client signup email? Thanks 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted April 6, 2012 Share Posted April 6, 2012 Um, probably not before the email is sent. As far as I know the ClientAdd hook is ran last in the entire chain of events. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.