First things first:
- In the Theme Manager in the backend add a new theme that inherits from Responsive
- It will be saved to themes/Frontend/Mytheme
- To add your own stylesheets to your theme put a file called all.less here:
themes/Frontend/Mytheme/frontend/_public/src/less/all.less
. It will automatically be compiled by Shopware’s own LESS processor - To add your own scripts to your theme put them in
themes/Frontend/Mytheme/frontend/_public/src/js/
and them to the$javascript
array inthemes/Frontend/Mytheme/Theme.php
(snippet below) - To immediately see your custom scripts and styles disable compiler cashing and CSS and JS compression in the settings of the Theme Manager
Adding a JavaScript file to your Shopware 5 Theme:
<?php
/**
* Javascript files which will be used in the theme
*
* @var array
*/
protected $javascript = array(
// Third party plugins / libraries
'src/js/app.js',
);