Cookie compliance integration for Shopware

Cookie compliance integration for Shopware

Nelson
Written by NelsonLast update 27 days ago

To install the CookieScript cookie banner code on Shopware, perform the following steps:

  1. Go to your Cookie-Script.com account > Settings > Installation.

  2. Configure geo-targeting (if needed).

  3. Download the CookieScript js file from the Installation section. You can read more about self-hosting of js files.

  4. Log in to your Shopware Admin Dashboard.

  5. Place the downloaded CookieScript file into the correct JS directory inside your custom theme.

  6. 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'
    ];
    
  7. 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.

Did this answer your question?