heyday Posted January 24, 2015 Share Posted January 24, 2015 (edited) I am trying to make changes to a PrestaShop site for someone. I believe the best way to make the changes is by making a module they can install. This module will be extending ProductCore with Product and it requires changes to templates. I want to make the module so that it doesn't conflict with existing and future modules for the site!! (as well, the module should be easy to change) Is this an impossible goal? What are the best practices with this thought in mind? I want the client to be able to add different styling themes to the PrestaShop without conflicts with the module, too. Thank you! Edited January 24, 2015 by heyday (see edit history) Link to comment Share on other sites More sharing options...
heyday Posted January 24, 2015 Author Share Posted January 24, 2015 Found some pretty good articles I'm finding useful: http://www.pixelkracht.nl/blog/fun-with-module-conflicts/ http://subasd.com.np/magento-high-level-architecture/ I'm seeing that modularity has its advantages but also the potential for causing more problems than if you just coded without modularity... Link to comment Share on other sites More sharing options...
vekia Posted January 25, 2015 Share Posted January 25, 2015 how these links are related to prestashop? they aren't... Link to comment Share on other sites More sharing options...
heyday Posted January 25, 2015 Author Share Posted January 25, 2015 I forgot to mention that Magento seems to have some similarities to PrestaShop. I think the points made in them are applicable to PrestaShop, like how with modules overriding the same class but only one taking precedence over the other one, leaving the other's functionality gone. It's solution of combining the class of each module may be obvious but is still a good one and its nice to see someone voicing this because hard to find things like it online... 1 Link to comment Share on other sites More sharing options...
cautbur Posted February 18, 2015 Share Posted February 18, 2015 So. There is a specific way to avoid conflicts?. I don't know if there is a way, but i have been searching for this case on google and can't find nothing. Really how a module developer could imagin a future use os his module core classes and methods overrides by other modules. I think this is a question to aks to Prestashop Core Developers. What we have to do? I think may we need a mechanism to detect other modules overrides. Prestashop have to inform us, in installation time, that a module has overrides on same class methods that you. You will have to declare your method (or an alternative method) in a way given by Prestashop, to tell Prestashop that you can provide a override for this module override that causes the conflict, also taking count of modules versión, so that Prestachop will be able to install a coorect override. This will not resolve the problem the first time, but give developers a way to resolve this problem for his clients. A client only have to inform to developers module of their connflict with other module versión. Developers will have a way to solve this problem rewriting a combination of two methods. If Prestashop could get us this mechanism, we can develop our modules wuth a standar override methods and methods for override in case that certains modules versions are present. I have to Note that also this solution have a drawback, how to override module over override module over override module ... (But this could be adressed in the same maner, if we know that the last installed module have to provide a methos for the previous non standar method solution provided by the previous developer to could override). Althought this could be infinite, i think that rarely we will have trhee or four modules with conflicts in the same part of code. PD: The only problem is define a legal clausule thtt permit modules developer use only in this case a certaint part of code from other author to recombine in a solution for module conflicts. 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