tommy100 Posted January 15, 2011 Share Posted January 15, 2011 Hi,I need to make some changes in php files located in the shop root (product.php, etc.) and also in some classes. What's the best way to do this, so future version upgrades are as hassle free as possible?Thanks!Tommy Link to comment Share on other sites More sharing options...
rocky Posted January 16, 2011 Share Posted January 16, 2011 In PrestaShop v1.4, you would override the ProductController and Product class so that modifying those files wasn't required, which makes upgrading easy. In PrestaShop v1.3 and earlier, the only option is to actually modify the files, then keep a log of the changes so you can make the same changes again when you replace the files with the updated ones. Link to comment Share on other sites More sharing options...
web.geek Posted January 16, 2011 Share Posted January 16, 2011 Rocky,Do you name the override php file the same as the original? If not, how does the system know to use your new file? Do you have to provide a constructor that calls the parent constructor? Can you just override specific functions, or do you copy the entire class and modify the code as needed?I have some OO knowledge with Java, but just need some direction to get started. Thanks Link to comment Share on other sites More sharing options...
otzy Posted January 16, 2011 Share Posted January 16, 2011 Hi,I need to make some changes in php files located in the shop root (product.php, etc.) and also in some classes. What's the best way to do this, so future version upgrades are as hassle free as possible? Use any version control system (svn, git...) and it's merge tool Link to comment Share on other sites More sharing options...
shokinro Posted January 16, 2011 Share Posted January 16, 2011 It is good to use version control tools. But I think this option only available for developers.Most store owner don't know how to use this kind of tools, just do some small changes by themselves or hire a developer to make changes. Link to comment Share on other sites More sharing options...
otzy Posted January 16, 2011 Share Posted January 16, 2011 It is good to use version control tools. But I think this option only available for developers.Most store owner don't know how to use this kind of tools, just do some small changes by themselves or hire a developer to make changes. you are righthttp://winmerge.org/ - simple and clean free tool for two files comparemay be it would be helpful Link to comment Share on other sites More sharing options...
shokinro Posted January 16, 2011 Share Posted January 16, 2011 I myself, use a version control tool.but the tool you suggested is good tool to compare difference between too file. Thanks for sharing. Link to comment Share on other sites More sharing options...
web.geek Posted January 16, 2011 Share Posted January 16, 2011 I use winmerge right now, but I would rather code according to OO practices. Plus, if they put a feature in the software for a purpose, I would like to use it for its intended purpose. Link to comment Share on other sites More sharing options...
rocky Posted January 17, 2011 Share Posted January 17, 2011 You should use the name of the class as the filename with PHP as the extension, then create a class that extends the class name ending with Core. You should override only functions you need to modify, not copy all the code. See my post here. 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