juani Posted October 8, 2014 Share Posted October 8, 2014 (edited) Hello, I'm experimenting with modules and overrides. I'd love to pack all my modifications to prestashop into one module, but I found that I can override core classes only from the $PRESTASHOP_ROOT/override folder. The same files, when placed in $PRESTASHOP_ROOT/modules/my_module/override, have no effect at all. I also couldn't find the class_index.php file indicated in the documentation, I have checked that the www-data user has write permissions in that folder, so what else? The module was activated in the backoffice, of course, and it displays a nice block in the front. It's only the overrides that do not work. Thanks in advance! Edited October 8, 2014 by juani (see edit history) Link to comment Share on other sites More sharing options...
juani Posted October 8, 2014 Author Share Posted October 8, 2014 My guess: the prestashop docs say: Contrary to the override code that is to be placed manually in the /override folder, module overrides are enabled as soon as the module is installed. During installation, overriding code is merge with those already in place (if any), otherwise they are copied to the /override folder at the root of the PrestaShop folder. so I guess I need to uninstall and install the module after every change? Not very handy, is it? I guess I'm left with working on the $PRESTASHOP_ROOT/override folder directly, and only when I'm done developing try to place the override code into a module and check in a fresh prestashop if it would install correctly to the override folder. Is that correct? Link to comment Share on other sites More sharing options...
razaro Posted October 8, 2014 Share Posted October 8, 2014 That works like this you place your files in my_module/override and in same structure with class and controllers sub-folders, and Prestashop on install copy those files to $PRESTASHOP_ROOT/override. So if you made some changes in module/override you need to reinstall. Also class_index.php is in root/cache folder 1 Link to comment Share on other sites More sharing options...
cristic Posted October 8, 2014 Share Posted October 8, 2014 If you are on 1.6 and class_index.php is not auto-regenerating, check this bug, which have been fixed: https://github.com/PrestaShop/PrestaShop/commit/664705149641661c494779ac197749239d916b42 There was a '/' missing from the path to class_index file. Make the 4 modifications in classes/PrestaShopAutoload.php and check again the existence of the file in cache dir. 2 Link to comment Share on other sites More sharing options...
juani Posted October 8, 2014 Author Share Posted October 8, 2014 If you are on 1.6 and class_index.php is not auto-regenerating, check this bug, which have been fixed: https://github.com/PrestaShop/PrestaShop/commit/664705149641661c494779ac197749239d916b42 There was a '/' missing from the path to class_index file. Make the 4 modifications in classes/PrestaShopAutoload.php and check again the existence of the file in cache dir. Thanks! 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