2
votes

I have a small problem with Shopware aplication. My point is, I create a new Theme which works perfectly, I can change any information at webpage using shopware backend profile, but when i copy the less files to my new repository folder, I cannot compile new theme. It stucks.

From the beginning, Creating a theme using parent Responsive, all works perfect, theme compile. Changing information on page, work perfect, theme compile. Copy less files from Responsive/_public/less to newrepository/frontend/_public/less etc and it stucks.

Right now i dont have any idea how I am suppose to deal with it.

Any ideas ?

4

4 Answers

4
votes

When a theme in shopware doesn't compile there is most probably something wrong with your less files. Have you copied all less files?

  • The path you mentioned is not correct.
  • syntax error in less files?
  • Did you copy the file Responsive/frontend/_public/src/less/all.less without copying the files that are imported in the all.less? Same applies for other files in this directory.

Whatever it is that is wrong with your less files. You shouldn't need to copy them from the parent theme. If you want to change something, just create your own files.

Say you want to have the background white. Create a file YOUR_THEME/frontend/_public/src/less/_modules/body.less with the content:

body {
  background: #fff;
}

Then you are also going to need a file YOUR_THEME/frontend/_public/src/less/all.less with the content:

@import "_modules/body";

No need to copy or modify the original files.

0
votes

Create a .css file here:

Responsive/frontend/_public/src/css/style.css

After that you should include the file in your Theme.php file like this:

protected $css = array('src/css/style.css');

under this function:

public function createConfig(Form\Container\TabContainer $container)
{

}

It worked for me. I have no idea how to include less files in a theme, they are usually added in a plugin by creating an event. I hope this helps.

Also Responsive Theme is default theme in Shopware. You should extend it and work on the newly created theme.

0
votes

I guess it is obviously but are you following the Shopware strukture?

all.less (@import "modules";)
--_modules (@import "_modules/your";)
---your.less

?

0
votes

Please don't copy all Less Files from the responsive theme. There are some mixins for the grid that stucks if you compile it twice, which is exactly the case if you copy all the files.