Skip to content

Commit

Permalink
Merge pull request PrestaShop#36726 from jolelievre/module-install-theme
Browse files Browse the repository at this point in the history
Add possiblity to customize the installer based on template from a module
  • Loading branch information
matthieu-rolland authored Aug 22, 2024
2 parents 1f26035 + 1dc7df0 commit 36fb458
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions install-dev/classes/controllerHttp.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

use PrestaShopBundle\Install\LanguageList;
use Symfony\Component\Finder\Finder;

class InstallControllerHttp
{
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 36fb458

Please sign in to comment.