Driven2a Posted March 22, 2012 Share Posted March 22, 2012 Hi could anyone tell me how to properly merge these two frontcontroller.php files? Thanks <?php // File: override/classes/FrontController.php class FrontController extends FrontControllerCore { function __construct() { parent::__construct(); } public function displayHeader(){ global $css_files, $js_files; if (!self::$initialized) $this->init(); // P3P Policies (http://www.w3.org/TR/2002/REC-P3P-20020416/#compact_policies) header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); /* Hooks are volontary out the initialize array (need those variables already assigned) */ self::$smarty->assign(array( 'time' => time(), 'static_token' => Tools::getToken(false), 'token' => Tools::getToken(), 'logo_image_width' => Configuration::get('SHOP_LOGO_WIDTH'), 'logo_image_height' => Configuration::get('SHOP_LOGO_HEIGHT'), 'priceDisplayPrecision' => _PS_PRICE_DISPLAY_PRECISION_, 'content_only' => (int)(Tools::getValue('content_only')) )); self::$smarty->assign(array( 'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_TOP' => Module::hookExec('top'), 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'), 'HOOK_LOF_TOP' => Module::hookExec('lofTop') )); if ((Configuration::get('PS_CSS_THEME_CACHE') OR Configuration::get('PS_JS_THEME_CACHE')) AND is_writable(_PS_THEME_DIR_.'cache')) { // CSS compressor management if (Configuration::get('PS_CSS_THEME_CACHE')) Tools::cccCss(); //JS compressor management if (Configuration::get('PS_JS_THEME_CACHE')) Tools::cccJs(); } self::$smarty->assign('css_files', $css_files); self::$smarty->assign('js_files', array_unique($js_files)); self::$smarty->display(_PS_THEME_DIR_.'header.tpl'); } } ?> <?php /* * 2007-2011 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 1.4 $ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class FrontController extends FrontControllerCore { public function process() { include_once(_PS_MODULE_DIR_.'/locationdetection/locationdetection.php'); $locationDetection = new LocationDetection(); $locationDetection->redirect_user(); parent::process(); } } ?> Link to comment Share on other sites More sharing options...
CartExpert.net Posted March 22, 2012 Share Posted March 22, 2012 Hello Copy public function process() { include_once(_PS_MODULE_DIR_.'/locationdetection/locationdetection.php'); $locationDetection = new LocationDetection(); $locationDetection->redirect_user(); parent::process(); } to the 1st one. Make sure it is between the brackets: class FrontController extends FrontControllerCore { /* FUNCTIONS GO HERE */ } 1 Link to comment Share on other sites More sharing options...
Driven2a Posted March 23, 2012 Author Share Posted March 23, 2012 Thank you very much this worked. Link to comment Share on other sites More sharing options...
CartExpert.net Posted March 23, 2012 Share Posted March 23, 2012 Happy we could help. Please mark the topic as [sOLVED] 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