WIP: Variation swatches: Default tooltip color is different in builder and frontend

Hi,

The Default Tooltip background color in variation swatches in the builder is gray, but in the front-end it is black.

Hi @Victor1999,

thank you for your report. I was able to replicate the issue locally and I’ve added it to our internal bug tracker.

Best regards,
Matej

Thank you @Matej,

is WIP now?

Yes, I just forgot to update the topic title. Thanks for reminding me! :slight_smile:

Best regards,
Matej

I’m dealing with a different scenario — the 'bricks-tooltips' JavaScript file is never enqueued in frontend. In assets.php on line 313, there’s a condition:

strpos( $bricks_settings_string, 'data-balloon' ) !== false

However, the $bricks_settings_string doesn’t contain any 'data-balloon' attribute, so the script never gets enqueued in frontend. I think is a bug to check data-balloon in frontend,
maybe check on \Bricks\Database::$global_settings[''woocommerceUseVariationSwatches'']

Hi @bricksonemore,

actually, you are right. I’ve tested again, this time when I’m logged out, and I can see that the tooltips are not even loaded. Can you test this two ways - if you are logged in and if you are logged out?
In my case, I can see the tooltip (although different colour), if I’m logged in, but there is no tooltip if I’m logged out.

If you can reproduce the then I’ll update the internal bug report.

Thanks and let me know.
Matej

Hi Matej,

Logged out - tooltips.css not enqueued in frontend.( not working )
Logged in as Subscriber/Customer - tooltips.css not enqueued in frontend.( not working )

Logged in as Admin - tooltips.css not enqueued in frontend, variation swatch tooltips works, but css from admin.min.css. ( working )

Yep, that’s what I observed as well. Thank you so much for confirming. :pray:

Best regards,
Matej

Hi guys,

We fixed this issue in Bricks 2.0 beta, which is now available in your account.
Changelog: Bricks 2.0-beta Changelog – Bricks

Please let us know if you are still experiencing issues.

As with any pre-stable release, please do not use it on a production/live website. It is only meant for testing in a local or staging environment.

Bricks 2.0 beta still doesn’t resolve the issue — tooltips-layer.min.css is not loading on the frontend.

Looking at assets.php around line 330, the $bricks_settings_string doesn’t include 'data-balloon'.

  /**
   * STEP: Load balloon (tooltip) CSS file
   *
   * Check for data-balloon-pos settings in Bricks data
  */
error_log(print_r($bricks_settings_string, true));	 
	if ( bricks_is_builder() || strpos( $bricks_settings_string, 'data-balloon' ) !== false ) {
	  wp_enqueue_style( 'bricks-tooltips' );
	}

But the colours are the same now, right?

At least for me, when I tested just now.

Best regards,
Matej

I am testing 2.0 and my color swatches dont have the tooltip pseudo classes on the swatch li.

The li does have the data-balloon attribute.

It does for me. Please show us a concrete example and steps on how we can reproduce the problem @mikestott

Hi, I still have the same issue.

If I’m logged, I can see the tooltip above swatches images when I hover. If I’m not logged, tooltips aren’t loaded when hovering variation images.

When logged, they’re loaded from admin.min.css. Is it still a in progress bug ?

Thanks
Bastien

Hi @Babas,

I can confirm that this issue continues to occur. As it’s different from the original one, can you open a new forum topic and tag me there? Then I will properly connec it to the internal task.

Thank you,
Matej

For anyone else facing this issue, drop the code below into your child theme.

add_action( 'wp_enqueue_scripts', 'enqueue_tooltips_assets', 35, 1);

function enqueue_tooltips_assets() {
	if ( ! \Bricks\Woocommerce::is_woocommerce_active() ) {
		return;
	}
	
	if ( ! \Bricks\Database::get_setting( 'woocommerceUseVariationSwatches' ) ) {
		return;
	}
	
	if ( ! is_product() ) {
		return;
	}
		
	wp_enqueue_style( 'bricks-tooltips' );
}
4 Likes

Thanks @bricksonemore! This fixed it, running Bricks 2.1.2.