Vatson2017 Posted March 3, 2019 Share Posted March 3, 2019 How to connect header and footer to Prestashop 1.7? In Prestashop 1.6 You could connect using: require ($ _ SERVER ["DOCUMENT_ROOT"]. "/ header.php"); ErShow (); echo $ MyContent; require ($ _ SERVER ["DOCUMENT_ROOT"]. "/ footer.php"); ?> Link to comment Share on other sites More sharing options...
NemoPS Posted March 4, 2019 Share Posted March 4, 2019 Not sure why one would use that syntax even on 1.6 to be honest. If you are trying to create a custom page I suggest you try this: http://nemops.com/creating-new-pages-in-prestashop/ 1 Link to comment Share on other sites More sharing options...
Vatson2017 Posted March 10, 2019 Author Share Posted March 10, 2019 Need all in one file. There is a special module 1pr.php Link to comment Share on other sites More sharing options...
NemoPS Posted March 11, 2019 Share Posted March 11, 2019 I don't think there is an easy way to run them outside a controller, there are too many variables assigned and required 1 Link to comment Share on other sites More sharing options...
Vatson2017 Posted March 12, 2019 Author Share Posted March 12, 2019 I'm interested in this part of the code <?php $_GET=Array(); $controller = new FrontController(); $tm=time(); $controller->init(); //echo 'init() '.(time()-$tm).' sec.<br>'; $tm=time(); //$controller->initContent(); //echo 'initContent() '.(time()-$tm).' sec.<br>'; $tm=time(); $controller->setMedia(); //$controller->initHeader(); $context->smarty->tpl_vars['page']->value['page_name'] = 'TDMod'; $context->smarty->tpl_vars['page']->value['meta']['title'] = TDM_TITLE; $context->smarty->tpl_vars['page']->value['meta']['description'] = TDM_DESCRIPTION; $context->smarty->tpl_vars['page']->value['meta']['keywords'] = TDM_KEYWORDS; $context->smarty->tpl_vars['page']->value['meta']['robots'] = ''; $controller->displayHeader(); //echo 'displayHeader() '.(time()-$tm).' sec.<br>'; $tm=time(); ?> <script src="/<?=TDM_ROOT_DIR?>/media/js/jquery214.min.js"></script> <script src="/<?=TDM_ROOT_DIR?>/media/js/colorbox/jquery.colorbox-min.js"></script> <link rel="stylesheet" href="/<?=TDM_ROOT_DIR?>/media/js/colorbox/cmain.css" /> <table><tr><td><?$arMSParams["LANG"]='it'; require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/vin/component.php');?> </td><td> <?$arKTParams["LANG"]='it'; require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/mselect/component.php');?> </table> <? require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/vin/component.php'); ErShow(); echo $TDMContent; $controller->displayFooter(); /* $_GET=Array(); //require($_SERVER["DOCUMENT_ROOT"]."/header.php"); ob_start(); require($_SERVER["DOCUMENT_ROOT"]."/header.php"); ?> <script src="/<?=TDM_ROOT_DIR?>/media/js/jquery214.min.js"></script> <?php $PrestaHeader = ob_get_contents(); $PrestaHeader = str_replace(array('</body>','</html>'),'',$PrestaHeader); $PrestaHeader = str_replace('id="pagenotfound"','',$PrestaHeader); $PrestaHeader = str_replace('class="pagenotfound"','',$PrestaHeader); ob_end_clean(); echo $PrestaHeader; ?> <script src="/<?=TDM_ROOT_DIR?>/media/js/jquery214.min.js"></script> <script src="/<?=TDM_ROOT_DIR?>/media/js/colorbox/jquery.colorbox-min.js"></script> <link rel="stylesheet" href="/<?=TDM_ROOT_DIR?>/media/js/colorbox/cmain.css" /> <table><tr><td><?$arMSParams["LANG"]='it'; require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/vin/component.php');?> </td><td> <?$arKTParams["LANG"]='it'; require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/mselect/component.php');?> </table> <? require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/vin/component.php'); ErShow(); echo $TDMContent; require($_SERVER["DOCUMENT_ROOT"]."/footer.php"); */ ?> On Prestashop 1.6 it works, and at 1.7 it does not work. Why? 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