diff --git a/install-dev/classes/controllerHttp.php b/install-dev/classes/controllerHttp.php index 01cf5c2bf809d..42f4b661f5013 100644 --- a/install-dev/classes/controllerHttp.php +++ b/install-dev/classes/controllerHttp.php @@ -25,6 +25,7 @@ */ use PrestaShopBundle\Install\LanguageList; +use Symfony\Component\Finder\Finder; class InstallControllerHttp { @@ -403,6 +404,16 @@ public function getTemplate(string $template): string return $this->renderTemplate($customPath, $template); } + // Loop through the modules in modules folder and search for a potential template override + $finder = new Finder(); + $finder->in(_PS_CORE_DIR_ . '/modules')->directories()->depth(0); + foreach ($finder as $dir) { + $moduleInstallTheme = $dir->getRealPath() . '/install-theme/'; + if (file_exists($moduleInstallTheme . $template . '.php')) { + return $this->renderTemplate($moduleInstallTheme, $template); + } + } + if (file_exists($path . $template . '.php')) { return $this->renderTemplate($path, $template); }