Jump to content

Recommended Posts

I have to thank @Gyakutsuki for all his help with this add-on and especially the multilingual code.

let’s you add a cookie widget to your site. This will allow your customer to refuse cookies if they wish to and let you comply with legislation.

What you allow will depend on who you are and what legal requirements you need to comply with. It is imposable to make an add-on that will work out of the box for all shops.

So this has 2 modules, one is a header_tag which installs the main script which loads the main js and makes language selection. The other is a footer_suffix which allows you to enter the custom scripts for your cookies.

You have 10 input boxes in footer_suffix admin to enter custom scripts. You do not need to use all 10, these are just to make management easy for most shops who will need only a few so can enter one into each box.

If you need more than ten then just add extras all into one box.

Included in the files is a list of some of the main scripts needed.

Simply copy from <script to </script> and paste into input box and save.

<script type="text/javascript">

(tarteaucitron.job = tarteaucitron.job || []).push('adsense');

</script>

 

That’s all that is required. If you need more scripts then go to this website and search for the one you need.

https://opt-out.ferank.eu/en/install/

The script is multilingual but I have only added a few to the code. These are in the header_tag class so if you need more you can edit it and add them.

 

$language_code == 'fr' ||

$language_code == 'en' ||

$language_code == 'nl' ||

$language_code == 'de' ||

$language_code == 'es' ||

$language_code == 'it' ||

$language_code == 'pt' ||

$language_code == 'pl' ||

$language_code == 'ru' ) {

 

That’s it again as always copy everything over into correct directory's don't forget to copy the new js files to ext.

Then go into admin and install and set up the 2 modules. You have to have both installed and set up. The rest is straightforward and should be self explanatory.

 

 

Enjoy.

image.thumb.png.aadaa1e4b1a7b517515fd7cf22093843.png

image.png.72bbba46b4bd99235f6224db9cfe1d5f.png

image.png.b6377688e2379cb70dac7ec95f1bbfed.png

 

Auto detect shop language.

image.thumb.png.41e9700b1f521f2241e7da9e8723feea.png

image.png.1bc99d47398c0c799789f8db0e4ddcdd.png

image.png.9116dca8e3c3f25731c0fc342c990337.png


 

Share this post


Link to post
Share on other sites

does the ext folder go inside the includes folder? I'm not seeing any modal appearing on the home page.


Ah, the world wide web. What a wonderful place.

Share this post


Link to post
Share on other sites

Found this error appearing:

Quote

PHP Warning:  Use of undefined constant footer_scripts - assumed 'footer_scripts'

on this line:

$oscTemplate->addBlock( '<script type="text/javascript"> var tarteaucitronForceLanguage =  ' . "'" . $language . "'"  . ' ;</script>' . "\n", footer_scripts);

Is this a php 7 issue?


Ah, the world wide web. What a wonderful place.

Share this post


Link to post
Share on other sites
22 minutes ago, freakystreak said:

does the ext folder go inside the includes folder? I'm not seeing any modal appearing on the home page.

In public_html you will find the ext folder.

Should be 2nd or 3rd folder listed

Share this post


Link to post
Share on other sites
Posted (edited)
17 minutes ago, Dnj1964 said:

In public_html you will find the ext folder.

Should be 2nd or 3rd folder listed

That's what I thought but are't the modules within the ext folder usually contained in their own folder? I have put it inside it's own folder named 'tarteaucitron' as that's where the script is pointing to but I'm still getting the above error

Edited by freakystreak
more information

Ah, the world wide web. What a wonderful place.

Share this post


Link to post
Share on other sites

Sorry, ignore my stupidity. I didn't realise you had to have a script active to make it work. Many apologies.


Ah, the world wide web. What a wonderful place.

Share this post


Link to post
Share on other sites
Posted (edited)

The "error" is just a "warning" yes related to version of PHP beeing used. You can get rid of the warning by editing that file like this.

$oscTemplate->addBlock( '<script type="text/javascript"> var tarteaucitronForceLanguage =  ' . "'" . $language . "'"  . ' ;</script>' . "\n", 'footer_scripts');
   	

All you are doing is replacing footer_scripts with  'footer_scripts'

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×