HeatMiseR Posted December 19, 2011 Share Posted December 19, 2011 Hello After making a few changes to the look of the store, adding a background and header to match my website, the log off function no longer works. I added the header by modifying the root index.php with a php include statement. The modified code is: include('banner.php'); require(dirname(__FILE__).'/config/config.inc.php'); ControllerFactory::getController('IndexController')->run(); All of the functions of the shop work fine except for logging out of your account. When you try to logout all you get on the next page is the header image with not shop below. If I remove “include(‘header.php’);” it goes back to working normally… Any ideas on why the include statement would break the logout function? Thanks! Link to comment Share on other sites More sharing options...
doekia Posted December 19, 2011 Share Posted December 19, 2011 why do you do such? header.php is a regular Prestashop file responsible to display the beginning of the page and need thing to be done prior such as initialisation. Did you screw this file with your content? Nothing need to be changed in the core file to achieve your needs I am guessing that not only logout function is wrong with your change ajax, forms and much more. Explain what this "inclusion" does, for what goal we will tell you how to do it. Best, (d)oekia Link to comment Share on other sites More sharing options...
HeatMiseR Posted December 19, 2011 Author Share Posted December 19, 2011 The name of the file is actually banner.php, I used header.php in the example... I did not overwrite the original header.php file… I needed to add a header on the top of the store to match the header on the rest of my site. Using the include achieved what I needed and all functions of the store work correctly EXCEPT for logging out… Link to comment Share on other sites More sharing options...
doekia Posted December 19, 2011 Share Posted December 19, 2011 No quite sure specially for the page redirections - which explains also why you cannot logout/login HTTP header has already been sent because of your code so cookie cannot be updated Just create a banner.tpl within your theme directory Then edit the header.tpl within your theme directory and use a statement such as {include file="$tpl_dir./banner.tpl"} at the proper place ... before {$HOOK_TOP} if your need is before modules in top-of-page after otherwise. If your need is some sort of a welcome screen investigate the use of an override on the IndexController override/controllers/IndexController.php Link to comment Share on other sites More sharing options...
HeatMiseR Posted December 19, 2011 Author Share Posted December 19, 2011 That sounds like a much better option than using the include with the root index.php I'll try it and let you know how it works! Thank you for the help!! Link to comment Share on other sites More sharing options...
HeatMiseR Posted December 19, 2011 Author Share Posted December 19, 2011 I created a banner.tpl file and used the include like you suggested but the page failed to load past where I inserted the inlcude statement. So instead I copied my code and inserted it into the same location in header.tpl and it worked! I'm checking the entire store to make sure but I'm confident that this is a better way to add my website header... Thank you for taking the time to help me out with this!! Link to comment Share on other sites More sharing options...
doekia Posted December 19, 2011 Share Posted December 19, 2011 Sorry typo of mine $tpldir should be read $tpl_dir I just edit the snippet to correct it. Link to comment Share on other sites More sharing options...
Mike Kranzler Posted December 19, 2011 Share Posted December 19, 2011 Thanks doekia! I'll go ahead and mark this topic as solved. -Mike Link to comment Share on other sites More sharing options...
Recommended Posts