Forums / All Other Contributions/Addons / cookie consent script

cookie consent script

Started by schoolboy on 30 Apr 2012, 12:36 PM · Views: 16,664

Results 21 to 40 of 84
2 Jun 2012, 11:15 AM
#21
rizla avatar

rizla

Zen Follower

Join Date:
Sep 2010
Posts:
449
Plugin Contributions:
0

cookie consent script

Thanks for the pointer schoolboy, got it working a treat!

4 Jun 2012, 12:45 PM
#22
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,779
Plugin Contributions:
2

Re: cookie consent script

keneso:

Nevermind.

I think I solved it, if someone please checks at amberprecious dot com, and confirms I'll appreciate.
The slider was using jscript_a_jquery-1.6.2.min.js, I deleted that, and put

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

in common/html_header.php right before

  • load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically

Hi Keneso
Could you walk me through in detail step by step EXACTLY what you did to get this to work on your site please? I too have a slider in header which breaks whenever I load the script into html_header.php

Many thanks

5 Jun 2012, 1:02 AM
#23
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,779
Plugin Contributions:
2

Re: cookie consent script

schoolboy:

We have managed to embed the COOKIE CONSENT system developed by http://www.wolf-software.com, into this "DEMO" site: http://carpclobber.com

Several minor edits, but not too difficult. Though we are TESTING this for any unseen glitches.

Hi Schoolboy
Could you advise how you were able to edit the wording of the drop down 'more info' box please? I cannot find a file or any reference to the html content within the downloaded folder to edit this.
Many thanks

5 Jun 2012, 6:30 AM
#24
kenny_1892 avatar

kenny_1892

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: cookie consent script

[QUOTE]> Hi Schoolboy

Could you advise how you were able to edit the wording of the drop down 'more info' box please? I cannot find a file or any reference to the html content within the downloaded folder to edit this.
Many thanks

picandnix:

Hi Keneso
Could you walk me through in detail step by step EXACTLY what you did to get this to work on your site please? I too have a slider in header which breaks whenever I load the script into html_header.php

Many thanks

This would also be helpful to me, as i'm having the same problem.

5 Jun 2012, 5:23 PM
#25
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: cookie consent script

Will this js work with 1.3.9x?

Learning Fast.
Eden Craft Supplies

5 Jun 2012, 7:18 PM
#26
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,779
Plugin Contributions:
2

Re: cookie consent script

adb34:

Will this js work with 1.3.9x?
Yep :-)

6 Jun 2012, 10:17 AM
#27
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: cookie consent script

Ta (thank you)

Learning Fast.
Eden Craft Supplies

8 Jun 2012, 10:17 AM
#28
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: cookie consent script

No matter what I do I cannot get this to work.

Can somebody put the instructions in KISS? I am using template 'IC Atheme', zencart v1.3.9.h

I know you guys have spent a long time talking about however little old cannot 'get it' Sorry :-(

Learning Fast.
Eden Craft Supplies

8 Jun 2012, 3:05 PM
#29
pudzpud avatar

pudzpud

Zen Follower

Join Date:
May 2009
Posts:
156
Plugin Contributions:
0

Re: cookie consent script

schoolboy:

Stage 5. Not correct...

CivicUK advises that the code is placed just BEFORE the closing </body> tag, so it goes into tpl_main_page.php (right at the bottom, just before the closing </body> tag.)

Hi,
I tried this but still cannot get anything to show up - so far I have uploaded the javascript file to a new folder under public_html called cookies and I have changed the script to show this and included it at the bottom of the tpl_main_page.php file just above the </body> tog but nothing shows up on my site - any help appreciated as I am tearing my hair out over this and civic quoted a huge amount of money to install this for me :(

I am obviously missing something as not too good with php so if someone can point me in the right direction I would appreciate it.

The code I have in my tpl_main_page.php is (this is just the bottom half of the file):

</table>

<?php
 /**
  * prepares and displays footer output
  *
  */
  if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_FOOTER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_footer = true;
  }
  require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');
?>

</div>
<!--bof- parse time display -->
<?php
  if (DISPLAY_PAGE_PARSE_TIME == 'true') {
?>
<div class="smallText center">Parse Time: <?php echo $parse_time; ?> - Number of Queries: <?php echo $db->queryCount(); ?> - Query Time: <?php echo $db->queryTime(); ?></div>
<?php
  }
?>
<!--eof- parse time display -->
<!--bof- banner #6 display -->
<?php
  if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>
<!--eof- banner #6 display -->
<script src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
<script src="/cookies/cookieControl-4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">//<![CDATA[
  cookieControl({
      introText:'<p>This site uses cookies to store information on your computer.</p>',
      fullText:'<p>Some cookies on this site are essential, and the site won\'t work as expected without them. These cookies are set when you submit a form, login or interact with the site by doing something that goes beyond clicking on simple links.</p><p>We also use some non-essential cookies to anonymously track visitors or enhance your experience of the site. If you\'re not happy with this, we won\'t set these cookies but some nice features of the site may be unavailable.</p><p>By continuing to use this website you are agreeing to the placing of these Cookies.</p><p>By using our site you accept the terms of our <a href="http://www.beeunique.co.uk/privacy.html">Privacy Policy</a>.</p>',
      position:'left', // left or right
      shape:'triangle', // triangle or diamond
      theme:'light', // light or dark
      startOpen:true,
      autoHide:10000,
      subdomains:true,
      onAccept:function(){ccAddAnalytics()},
      onReady:function(){},
      onCookiesAllowed:function(){ccAddAnalytics()},
      onCookiesNotAllowed:function(){},
      countries:'' // Or supply a list ['United Kingdom', 'Greece']
      });

      function ccAddAnalytics() {
        jQuery.getScript("http://www.google-analytics.com/ga.js", function() {
          var GATracker = _gat._createTracker('');
          GATracker._trackPageview();
        });
      }
   //]]>
</script> 
</body>
8 Jun 2012, 3:18 PM
#30
pudzpud avatar

pudzpud

Zen Follower

Join Date:
May 2009
Posts:
156
Plugin Contributions:
0

Re: cookie consent script

Sorry for double posting but it wont let me edit post above.

I have found that the tpl_main_page.php file shows up in 4 different places - I changed the one with the red * - should I change it somewhere else instead?

Attachment 10588

9 Jun 2012, 8:57 AM
#31
asekeris avatar

asekeris

New Zenner

Join Date:
Mar 2006
Location:
Zevenbergen, NL
Posts:
40
Plugin Contributions:
0

Re: cookie consent script

With all the hints here i got it working on my test site. - Thanks

Does anybody have a clue how to handle multiple languages for this?

9 Jun 2012, 9:03 AM
#32
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: cookie consent script

PudzPud:

Sorry for double posting but it wont let me edit post above.

I have found that the tpl_main_page.php file shows up in 4 different places - I changed the one with the red * - should I change it somewhere else instead?

Attachment 10588

The tpl_main_page.php MUST sit inside the COMMON folder(s) of the templates you have installed. If you have tpl_main_page.php in other directories, delete these instances.

Your asterisk shows you have edited the incorrect file. The one that needs editing sits inside the COMMON folder of your custom template.

20 years a Zencart User

9 Jun 2012, 9:05 AM
#33
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: cookie consent script

asekeris:

With all the hints here i got it working on my test site. - Thanks

Does anybody have a clue how to handle multiple languages for this?

If your site is LOCATED in the UK, then concern yourself only with English. IF it is LOCATED in another EU country, then translate the text to the language of that country.

If your site serves multiple countries, then just have the text in the language of your home country.

20 years a Zencart User

9 Jun 2012, 11:40 AM
#34
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: cookie consent script

The tpl_main_page.php MUST sit inside the COMMON folder(s) of the templates you have installed. If you have tpl_main_page.php in other directories, delete these instances

Which script are you talking about? Zencart plugin or http://civicuk.com/cookie-law?

Learning Fast.
Eden Craft Supplies

9 Jun 2012, 12:08 PM
#35
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: cookie consent script

adb34:

Which script are you talking about? Zencart plugin or http://civicuk.com/cookie-law?

civicuk

(But irrespective of the script, your tpl_main_page.php should not exist in folders outside of the COMMON folder in your templates.)

20 years a Zencart User

9 Jun 2012, 12:20 PM
#36
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: cookie consent script

Forget the last post of mine. I have http://civicuk.com/cookie-law working !!!!!!!!!!! Taken me long enough.

As Schoolboy says, for http://civicuk.com/cookie-law to work you must edited the tpl_main_page.php inside the common folder under YOUR-TEMPLATE (I have put my code just before the </body> command.

Complete all questions info on the page then click on 'collect the code'.

Then you click on 'Download the Cookie Control script here' this will take you to the control script. Save this page as javascript and as cookieControl-4.1.min.js, this title may be put in for you. Now this is the bit I could not get my head around, where to put the javascript? I put mine in sub folder 'lib' in my route directory.

Then go back. On left side is some code pick that up and paste it into your /includes/templates/YOUR_DIRECTORY/common/tpl_main_page.php. Make changes to script as to where you have put your javascript. Mine says <script src="lib/cookieControl-4.1.min.js" type="text/javascript"></script> (where 'lib' directory is in the same file as my index page is).

I hope this helps you, or I might have got you completely lost. I have used this script as I cannot get the other plugin to work.

Learning Fast.
Eden Craft Supplies

9 Jun 2012, 5:48 PM
#37
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: cookie consent script

OK I was to quick. This method only worked once and now has given up. :-(

Learning Fast.
Eden Craft Supplies

9 Jun 2012, 6:02 PM
#38
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,779
Plugin Contributions:
2

Re: cookie consent script

adb34:

Forget the last post of mine. I have http://civicuk.com/cookie-law working !!!!!!!!!!! Taken me long enough.

As Schoolboy says, for http://civicuk.com/cookie-law to work you must edited the tpl_main_page.php inside the common folder under YOUR-TEMPLATE (I have put my code just before the </body> command.

Complete all questions info on the page then click on 'collect the code'.

Then you click on 'Download the Cookie Control script here' this will take you to the control script. Save this page as javascript and as cookieControl-4.1.min.js, this title may be put in for you. Now this is the bit I could not get my head around, where to put the javascript? I put mine in sub folder 'lib' in my route directory.

Then go back. On left side is some code pick that up and paste it into your /includes/templates/YOUR_DIRECTORY/common/tpl_main_page.php. Make changes to script as to where you have put your javascript. Mine says <script src="lib/cookieControl-4.1.min.js" type="text/javascript"></script> (where 'lib' directory is in the same file as my index page is).

I hope this helps you, or I might have got you completely lost. I have used this script as I cannot get the other plugin to work.

schoolboy:

If your site is LOCATED in the UK, then concern yourself only with English. IF it is LOCATED in another EU country, then translate the text to the language of that country.

If your site serves multiple countries, then just have the text in the language of your home country.

Hi Schoolboy,
Thank you for all the hints n tips, I have got the wolf script working :-) but I would love to alter the text to something more informative and less technical for Joe Public to understand. Could you please describe how you changed the text in your example site please, please, please.

9 Jun 2012, 6:06 PM
#39
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,779
Plugin Contributions:
2

Re: cookie consent script

adb34:

OK I was to quick. This method only worked once and now has given up. :-(

Lol oh no :-( well once I get to my p.c later I can advise how I got the wolf script working on my site, if you would like me to? it works fine, https://www.shabbylane.co.uk

9 Jun 2012, 6:35 PM
#40
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: cookie consent script

I have got the http://civicuk.com/cookie-law working. It is all down to a / in the wrong place. The line src="/PATH_TO_COOKIE_CONTROL/cookieControl-4.1.min.js" cookie control path, I have found, I should not have the / before it. With it the script does not work without it it does. IE my script says; > <script src="lib/cookieControl-4.1.min.js" type="text/javascript"></script> and not > <script src="/lib/cookieControl-4.1.min.js" type="text/javascript"></script>

Learning Fast.
Eden Craft Supplies