Cookie compliance integration for PrestaShop 1.7

Go to your Cookie-Script.com account click " </>use" button and copy your item's src attribute's value (i.e. file URL)

prestashop

Open to {project_directory}/classes/controller/FrontController.php file

Go to setMedia() function

Add the following code, where your-file-URL is your item's src attribute value.

$this->registerJavascript(
'remote-bootstrap',
'your-file-URL',
['server' => 'remote', 'position' => 'head', 'priority' => 20]
);

There are 2 positions where you can set your CookieScript file:

1 - top of the page (inside <header>) by setting the position to top like this ‘position’ => ‘top’ 
2 - the end of the tag <body> by ‘position’ => ‘bottom’ 

Cookie-Script is installed on PrestaShop 1.7 now and should be ready for use.

 
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.