IeM Posted October 26, 2015 Share Posted October 26, 2015 Hi, Just wounding if a code snippet can be added to a controller class function without overriding the whole function? Example: I need to add a line of code after a New Customer object has been created and authenticated in AuthControllerCore->processSubmittLogin() I'm assuming that I have to copy the entire function to a Class override to do this but am not 100% sure and am hoping that there is another way without adding it to the actual core file its self. Thanks Link to comment Share on other sites More sharing options...
taydotech123 Posted October 26, 2015 Share Posted October 26, 2015 yes, copy & override is best solution in prestashop Link to comment Share on other sites More sharing options...
IeM Posted October 26, 2015 Author Share Posted October 26, 2015 Thanks taydotech123, I was thinking that was the case. Link to comment Share on other sites More sharing options...
cristic Posted October 27, 2015 Share Posted October 27, 2015 Depending on what modification you want to add, you can also use actionAuthentication hook, which is called after the context is created. Link to comment Share on other sites More sharing options...
IeM Posted October 27, 2015 Author Share Posted October 27, 2015 Thanks cristic, It is basically to set some session vars with details generated from the login so that could in dead be viable. Link to comment Share on other sites More sharing options...
cristic Posted October 28, 2015 Share Posted October 28, 2015 Usually, my order of changes are as follows: 1. Prestashop settings (standard or modules); 2. Hooks; 3. Overrides; 4. Core files modifications 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