Jump to content

How to extend classes and controllers in 1.7?


Recommended Posts

Hello,

 

I want to extend some core classes and controllers via a module but I don't know how. I can do it with overrides but according to the developers this isn't a good way:

 

 

The legacy architecture can still be overridden, though. But in general, we advise against overriding code. It is better to extend it.

 

But how can I extend it? Is there any code example?

 

Best regards

Link to comment
Share on other sites

You can still use overrides in PS v1.7 for classes and controllers, however if you plan to submit your module to the addons store, be prepared for it to be declined. 

 

I have no idea what they mean by extending it instead, the use of an override IS extending the core class.

 

If you are not selling your module on the addons store, then just use the override

Link to comment
Share on other sites

You can try, they are most likely going to reject it, but you can explain in the comments to them why you have to create an override, and that Prestashop has not designed any other way for you to accomplish this.

 

Make sure you also make it clear to your customers, that the module includes an override.

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...