csogilvie Posted February 16, 2011 Share Posted February 16, 2011 Am I missing something?In Prestashop 1.4 (RC2 ATM), it is possible to override some of the default classes that come with Prestashop, by putting files in the overrides/classes/ folder...However, it doesn't appear that it's possible to ADD new classes by putting them in there - would this not make more sense or am I missing something as to why NEW classes need to be created in the classes/ folder? Link to comment Share on other sites More sharing options...
Paul C Posted February 17, 2011 Share Posted February 17, 2011 As I understand it; If you want your class to be for example "MyClass" then you create a file called MyClass.php in /classes and use the following declaration: class MyClassCore extends ObjectModel { } You'll notice that we had to add "Core" on the end. To use your class you just use: $myvariable = new MyClass(); The side-effect of this is that you can override your own custom class (but would you really want to that often?), but yes, you're correct in saying that you would have assumed that you could have placed your own new classes directly into /overrides/classes and then extended just ObjectModel....Paul 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