Skip to content

Instantly share code, notes, and snippets.

@jonpontet
Created December 16, 2021 14:54
Show Gist options
  • Save jonpontet/a7e361f8f2e00627c430fb2d2622c2d6 to your computer and use it in GitHub Desktop.
Save jonpontet/a7e361f8f2e00627c430fb2d2622c2d6 to your computer and use it in GitHub Desktop.
How to include custom CSS in the Back Office of PrestaShop
<?php
public function install()
{
if ($this->registerHook('actionAdminControllerSetMedia')) {
return true;
}
$this->uninstall();
return false;
}
public function hookActionAdminControllerSetMedia() {
// Add the path to your CSS file
// path_to_modules/this_module_name/path_to_css_file.js
$this->context->controller->addCSS(__PS_BASE_URI__ . 'modules/' . $this->name . '/' . 'file_name.css');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment