Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1414417

    Hi team!

    Thank you for adding a cookie consent tool to the theme. I found it very useful. I just wanted to see if there was a way to “timeout” or auto accept upon scrolling ?

    I do not have an EU website, but we do want to add this to our site. I set the basic one up, but did not see an option to “accept all upon scroll” or a way to add a timeout where the notice goes away after 10 seconds or so. Is there a way to do this?

    Thanks!

    #1414418

    Also on Chrome and Edge it looks really bad.

    #1414469

    Hi,

    Thank you for the inquiry.

    or auto accept upon scrolling ?

    This option is not available by default, but we can add a script to hide the consent bar on scroll and auto accept the cookies. Please add the following code in the functions.php file.

    function ava_custom_script_c() { 
    	?>
    	<script>
    		(function($) {
    			$(window).scroll(function (event) {
    				var scroll = $(window).scrollTop();
    				
    				if(scroll > 1500) {
    					$('.avia-cookie-consent-wrap').fadeOut( "slow", function() {
    						console.log('consent bar hidden');
    					});
    
    					$('.avia-cookie-consent-button-1').trigger('click');
    				}
    			});
    		}(jQuery)); 
    	</script>
    	<?php
    }
    add_action('wp_footer', 'ava_custom_script_c', 9999);
    

    Best regards,
    Ismael

    #1414547

    Hi, will this also fix the formatting issue on Chrome and Edge? Those both do not show a bar at the bottom of the screen and instead edit the footer which looks very strange.

    #1414629

    Hi,

    Thank you for the update.

    Did you install a compression or cache plugin? Please disable the plugins temporarily, then toggle or temporarily disable the Enfold > Performance > File Compression settings to regenerate the scripts and stylesheets. Let us know if this helps.

    Best regards,
    Ismael

    #1415094

    Hi, so the compression plugin was the issue. We disabled, cleared cache and it fixed it. We also go the code added as per instructed with our developer, but it does not seem to be working (even after updating and clearing cache)

    Advice?

    #1415112

    Hi,

    We get the following error whenever we access the site, which might be the reason why the script above is not working. To fix the issue, we adjusted the code a bit. Please try it again and make sure to purge the cache afterwards.

    Uncaught ReferenceError: jQuery is not defined
        at (index):760:6
    

    Best regards,
    Ismael

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.