Cookie compliance integration for Shopware
Cookie compliance integration for Shopware
To install the CookieScript cookie banner code on Shopware, perform the following steps:
Go to your Cookie-Script.com account > Settings > Install:
Configure geo-targeting (if needed).
Download the CookieScript js file from the Install section. You can read more about self-hosting of js files.
Log in to your Shopware Admin Dashboard.
Place the downloaded CookieScript file into the correct JS directory inside your custom theme.
Add the downloaded file paths to the $javascript variable in your Theme.php file, relative to the _public directory:
protected $javascript = [ 'src/js/[cookie-script file name].js' ];
After the CookieScript JS file was added, it has to be compiled. There are two ways of doing this:
For production mode:
Go to the administration panel > Configuration > Caches & Performance > Caches and check the Compile themes option.
For development mode:
Go to the administration panel -> Configuration -> Theme Manager -> Settings -> Disable compiler caching.
On the other side, to compile theCookieScript JS file in development mode, the best way is to use the grunt file watcher.
CookieScript is installed on Shopware now and should be ready for use.
Note: If the banner doesn’t appear after the implementation, check if you don’t use any Cache plugin or extension, which prevents the banner from popping-up.
Did this answer your question?