Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 4 replies, has 2 voices.

Last updated by vadimP 10 months ago.

Assigned support staff: Bigul.

Author Posts
March 16, 2021 at 1:50 pm

vadimP

Hi,

We are running our website on Enfold and using the cookie consent bar that comes within the theme settings. Our website uses 2 languages and when switching between them - the consent bar is constantly showing up after it's already been hidden.
Website: hidden link

You can test by clicking the 1st button inside the cookie pop-up (accept all), then switching to the RU version - the same cookie pop-up will show up, no matter how many times you accept the cookie settings.

March 16, 2021 at 3:14 pm
March 17, 2021 at 8:11 am #8328567

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

The issue is existing after the initial checking. So I will consult about this with our second-tier team for an expert opinion and get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

March 19, 2021 at 8:15 am #8349183

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

The issue is existing after the primary debugging steps. So the ticket is escalated to our second-tier team for further debugging. We back to you as soon as possible. Please wait.

--
Thanks!

Bigul

March 22, 2021 at 2:22 pm #8368969

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

This bug is happening because of a compatibility conflict with Enfold Cookie settings. We are getting the expected result on your staging and our local copies after adding the following code in the functions.php file. Please check the attached image for more details.

add_filter('avf_cookie_consent_for_md5', function ($cookie_contents){
	
	$default_lang = apply_filters( 'wpml_default_language', null );
	
	$message = avia_wpml_get_options('cookie_content');
	$message = do_shortcode( (array) $message[$default_lang] );
	$buttons = avia_wpml_get_options( 'msg_bar_buttons' ) ? avia_wpml_get_options( 'msg_bar_buttons' ) : [];
	$cookie_contents = $message;
	
	foreach( $buttons as $button ) {
		$cookie_contents .= $button['msg_bar_button_label'];
	}
	
	return $cookie_contents;
});

Our compatibility developers will update Enfold team about this soon and hope they will include this fix in the future version of the theme. So please try this workaround for time being after a full site backup and make sure you are getting the expected results now on the live site.

--
Thanks!

Bigul

2021-03-22_19-35-03.png
March 22, 2021 at 4:25 pm #8370001

vadimP

Hi,

Thank you for your help! The code has solved our issue on the live site, all sorted now.