1

I am trying to create a theme for OpenCart v3 and like its default theme I am also using bootstrap framework. There are no files with SCSS/SASS extension but every time I refresh the page it looks into bootstrap.min.css file and somehow breaks it down into scss files and compiles it again. Due to this the default bootstrap over rides all my styles.

I remember I once accidentally clicked the scss clean cache button but this does not mean I allowed it to keep on breaking and recompiling bootstrap again and again even the scss make cache option is on.

It comes up with these kind of links.

Here is a sample to explain the problem copied from inspect element about having no border radius anywhere on the theme:

// ...opencart/catalog/view/javascript/bootstrap4/css/bootstrap.min.css
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 10rem;
padding: .5rem 0;
margin: .125rem 0 0;
font-size: 1rem;
color: #212529;
text-align: left;
list-style: none;
background-color: #fff;
background-clip: padding-box;
border: 1px solid rgba(0,0,0,.15);
border-radius: .25rem;
}

// .. opencart/catalog/view/theme/alpha/stylesheet/theme.css
.dropdown-menu, * {
border-radius: 0;
}

How can I stop scss compiler permanently? or on the other hand if I prefer to write my own Scss file instead of CSS then will OpenCart compile that too for the development phase of do I need to use terminal for that as I always do?

Found the following code in OpenCart but I don't understand this:

class ControllerStartupSass extends Controller {
public function index() {
    $file = DIR_APPLICATION . 'view/theme/' . $this->config->get('theme_directory') . '/stylesheet/bootstrap.css';

    if (!is_file($file) || (is_file(DIR_APPLICATION . 'view/theme/' . $this->config->get('theme_directory') . '/stylesheet/sass/_bootstrap.scss') && !$this->config->get('developer_sass'))) {
        include_once(DIR_STORAGE . 'vendor/scss.inc.php');

        $scss = new Scssc();
        $scss->setImportPaths(DIR_APPLICATION . 'view/theme/' . $this->config->get('theme_directory') . '/stylesheet/sass/');

        $output = $scss->compile('@import "_bootstrap.scss"');

        $handle = fopen($file, 'w');

        flock($handle, LOCK_EX);

        fwrite($handle, $output);

        fflush($handle);

        flock($handle, LOCK_UN);

        fclose($handle);
    }
}
}
halfer
  • 19,824
  • 17
  • 99
  • 186
kamran shah
  • 117
  • 4
  • 16

1 Answers1

2

Just turn off SASS and theme cache:

  1. Go to admin panel
  2. Click the blue button with gearwheel
  3. Click "off" buttons
  4. And clear cache

Image

Image

FoXXXiT
  • 33
  • 6