Jump to content

HOW TO: Configure multiple module directories without overwriting default


Recommended Posts

Most of the themes I've installed come with their own customised modules (and often more) directories. In each case, the installation instructions require the customised modules to be copied into the default modules directory. Correct me if I'm wrong but this would make it impossible to switch between themes properly.

What I want is to have multiple directory structures that will allow the directories of all installed themes to coexist and function properly without any overwriting. How can this be achieved? Would modifying /config/defines.inc.php do the trick? Any other ideas?

TIA

Link to comment
Share on other sites

It depends whether the themes modify the default PrestaShop module PHP files. If they modify the TPL files only, then they can be moved into the theme's directory, allowing you to leave the default PrestaShop module TPLs in the modules directory. For example, put the modified modules/blockuserinfo/blockuserinfo.tpl into themes/themename/modules/blockuserinfo/blockuserinfo.tpl. If the theme contains new modules, they can be copied into the modules directory since they won't affect any other themes unless they also use the same module. For modules with modified PHP code in multiple themes, you can rename one of the modules so you don't have to overwrite modules.

Link to comment
Share on other sites

I was hoping there'd be another way that didn't involve manually renaming files.

What about just changing /config/defines.inc.php to point to a different directory tree. Do you think that would do the trick?

Link to comment
Share on other sites

I suppose you could have one modules and one modules2 directory that contain different modules and change line 23 from:

define('_MODULE_DIR_',        __PS_BASE_URI__.'modules/');



to:

define('_MODULE_DIR_',        __PS_BASE_URI__.'modules2/');



This feels find of hacky though. It would be better to follow the advice in my previous post instead.

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