the_raven Posted June 15, 2014 Share Posted June 15, 2014 (edited) Hi everybody. I have used override in my shop to load some css and javascript on my custom theme. on wamp server everything work's as well ( exept some pages that javascript does'nt load there ) . but since i moved my shop from local to live server "FrontController.php" that i have made on >> override/controllers/front, cause white screen and so long as FrontController.php is Exist on server this problem persist. i tried to attach javascript files to header.tpl but they doesn't load by this way too. here is my FrontController.php content : <?php class FrontController extends FrontControllerCore { public function setMedia() { parent::setMedia(); // JS and CSS files $this->context->controller->addJS(_THEME_JS_DIR_.'jquery.easydropdown.js','all'); $this->context->controller->addJS(_THEME_JS_DIR_.'mychanges.js','all'); $this->context->controller->addJS(_THEME_JS_DIR_.'icheck.min.js','all'); $this->context->controller->addCSS(_THEME_CSS_DIR_.'skins/square/red.css','all'); $this->context->controller->addCSS(_THEME_CSS_DIR_.'easydropdown.flat.css','all'); $this->context->controller->addJS(_THEME_JS_DIR_.'jquery.tipsy.js','all'); $this->context->controller->addCSS(_THEME_CSS_DIR_.'tipsy.css','all'); } } please help me solve this problem. appreciate any suggestion thank you Edited June 17, 2014 by the_raven (see edit history) Link to comment Share on other sites More sharing options...
PSfever.com Posted June 16, 2014 Share Posted June 16, 2014 If for whatever reason the overriding does not work for you, how about adding single line with JS code into the frontController.php file? Btw, have you checked whether overriding is enabled in BackOffice? Link to comment Share on other sites More sharing options...
NemoPS Posted June 16, 2014 Share Posted June 16, 2014 Erase your addJs and CSS, try with parent::setMedia only, does it work? Link to comment Share on other sites More sharing options...
the_raven Posted June 17, 2014 Author Share Posted June 17, 2014 Dear Nemo, as you said i changed the code this : <?php class FrontController extends FrontControllerCore { public function setMedia() { parent::setMedia(); $this->context->controller->(_THEME_JS_DIR_.'jquery.easydropdown.js'); $this->context->controller->(_THEME_JS_DIR_.'mychanges.js'); $this->context->controller->(_THEME_JS_DIR_.'icheck.min.js'); $this->context->controller->(_THEME_CSS_DIR_.'skins/square/red.css'); $this->context->controller->(_THEME_CSS_DIR_.'easydropdown.flat.css'); $this->context->controller->(_THEME_JS_DIR_.'jquery.tipsy.js'); $this->context->controller->(_THEME_CSS_DIR_.'tipsy.css'); } } but the problem still persist. can you explain me what is the main reason that this codes works on local but not on Live server ? and can you give me some guidance for load this javascript and css files into my theme ? i searched alot but i couldn't find a good and appropriate way to do that . even the override is not a good way in my idea , because it is separated from theme and if you move the theme you will lost some codes.. thank you Link to comment Share on other sites More sharing options...
NemoPS Posted June 18, 2014 Share Posted June 18, 2014 Try this <?php class FrontController extends FrontControllerCore { public function setMedia() { parent::setMedia(); die('here'); } } Go to cache/ and erase class_index.php. See if it dies then Link to comment Share on other sites More sharing options...
the_raven Posted August 7, 2014 Author Share Posted August 7, 2014 Try this <?php class FrontController extends FrontControllerCore { public function setMedia() { parent::setMedia(); die('here'); } } Go to cache/ and erase class_index.php. See if it dies then what does die do ?? _____ finally i did "PSfever.com" advise and added single line to main frontController.php and problem solved . now i have js files loaded in my shop but i recently i upgraded my shop to 1.5.2.6 and I have loosed all the changes !! i think it can has a better way ! Link to comment Share on other sites More sharing options...
NemoPS Posted August 9, 2014 Share Posted August 9, 2014 Die(); kills the script execution, it was just to see if the override was working Link to comment Share on other sites More sharing options...
Recommended Posts