问题
My override is not working
I tried to add a custom.css the safe way to our default bootstrap theme. I followed this tutorial:
http://www.prestadb.com/prestashop-override-controllers-tutorial/
The difference to 1.6 should be that the file should be placed in:
/override/controllers/front
instead of
/overrides/controllers/
In the first mentioned directory I have a file called FrontControllerCore.php with following content:
<?php
class FrontController extends FrontControllerCore
{
public function setMedia()
{
parent::setMedia();
$this->addCSS(_THEME_CSS_DIR_.'custom.css');
}
}
?>
But the custom.css is not loaded, I do not see it in the source code of the frontend. What am I missing here?
回答1:
Ahh my fault I found it!
The name of the file should be FrontController.php and for this to be loaded, you have to manually delete the cache/class_index.php file!
回答2:
if you need to simply add a custom.css to a theme you can create a custom.css file in:
/themes/my_theme/css/autoload/custom.css
instead of override the controller
来源:https://stackoverflow.com/questions/23472036/override-controller-in-prestashop-1-6