Jurist Posted March 22, 2022 Share Posted March 22, 2022 Hello, How do I properly override core Customer.php class and it's private function create(Customer $customer, $clearTextPassword) I want to make the password to be automatically generated if empty. I am able to do that without any issues but I have to edit the core class. I am sure this is not the right approach, is the same possible through the module or override? I can create and then publish that module if someone gives me a tip on how this should be done the proper way. Thanks Link to comment Share on other sites More sharing options...
joseantgv Posted March 23, 2022 Share Posted March 23, 2022 Override the previous function (which should be public) who calls this function and generate a random password. 1 Link to comment Share on other sites More sharing options...
Jurist Posted March 23, 2022 Author Share Posted March 23, 2022 (edited) Okay thanks @joseantgv, I will work on it and post if there are any results. I will try to find a function that executes Customer class but lets see. Edited March 23, 2022 by Jurist (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted March 25, 2022 Share Posted March 25, 2022 It's not necessary to override any function, you can use actionObjectCustomerAddBefore hook. 1 Link to comment Share on other sites More sharing options...
Jurist Posted March 25, 2022 Author Share Posted March 25, 2022 Thanks Jose. I think that will be the proper solution. I will try to write a plugin and post it here as promised soon. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now