getSmartyDirectories example

if (!$controller->View()->hasTemplate()) {
            return;
        }

        /** @var Shop $shop */
        $shop = $this->container->get('shop');

        $inheritance = $this->container->get('theme_inheritance');

        $templateManager = $this->container->get('template');
        $templateManager->addPluginsDir(
            $inheritance->getSmartyDirectories($shop->getTemplate())
        );

        $themeSettings = $templateManager->getTemplateVars('theme');
        if (!empty($themeSettings)) {
            return;
        }

        $config = $inheritance->buildConfig(
            $shop->getTemplate(),
            $shop,
            false
        );


        $template = $shop->getTemplate();
        if (!$template instanceof Template) {
            return;
        }

        $inheritance = $this->container->get('theme_inheritance');
        $config = $inheritance->buildConfig($template$shop, false);

        $this->container->get('template')->addPluginsDir(
            $inheritance->getSmartyDirectories($template)
        );
        $this->View()->assign('theme', $config);
    }
}
Home | Imprint | This part of the site doesn't use cookies.