Skip to content

Fixed tooltip on checbox#559

Merged
Soare-Robert-Daniel merged 4 commits intodevelopmentfrom
bugfix/240
Apr 14, 2026
Merged

Fixed tooltip on checbox#559
Soare-Robert-Daniel merged 4 commits intodevelopmentfrom
bugfix/240

Conversation

@girishpanchal30
Copy link
Copy Markdown
Contributor

Summary

Added a tooltip to the checkbox options.

Check before Pull Request is ready:

Closes #240

@girishpanchal30 girishpanchal30 requested a review from Copilot April 6, 2026 06:32
@girishpanchal30 girishpanchal30 added the pr-checklist-skip Allow this Pull Request to skip checklist. label Apr 6, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Apr 6, 2026
@girishpanchal30 girishpanchal30 linked an issue Apr 6, 2026 that may be closed by this pull request
@pirate-bot
Copy link
Copy Markdown
Contributor

pirate-bot commented Apr 6, 2026

Plugin build for e0215b2 is ready 🛎️!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes missing frontend display of per-option tooltips for checkbox inputs by rendering a tooltip icon next to each option label when enabled.

Changes:

  • Adds a desc_tooltip gate ($is_tooltip_enabled) for checkbox option tooltips.
  • Extracts each option’s tooltip text and renders a tooltip icon in the checkbox option label when present.
Comments suppressed due to low confidence (1)

templates/frontend/inputs/checkbox.php:101

  • The new tooltip rendering can duplicate the tooltip icon when $has_discount is true: in the discount branch $option_label is already built with a tooltip HTML fragment (via $tooltip), and then another tooltip is appended in the label output when $option_tooltip is non-empty. Also, the discount-branch tooltip currently bypasses $is_tooltip_enabled, so tooltips may appear even when the “Show tooltip” setting is off. Consider building a single tooltip HTML fragment gated by $is_tooltip_enabled and using it in both branches, ensuring only one tooltip gets rendered per option.
		$option_tooltip = isset( $value['tooltip'] ) ? $value['tooltip'] : '';

		// if discount price set
		if ( $has_discount ) {
			$price        = $discount_price > 0 ? wc_format_sale_price( $option_price, $discount_price ) : wc_price( $option_price );
			$tooltip      = $tooltip ? ' <span data-ppom-tooltip="ppom_tooltip" class="ppom-tooltip" title="' . esc_attr( $tooltip ) . '"><span class="ppom-tooltip-icon" style="background-color:' . esc_attr( $icon_color ) . '"></span></span>' : '';

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread templates/frontend/inputs/checkbox.php Outdated
Comment thread templates/frontend/inputs/checkbox.php Outdated
Comment on lines +150 to +153
<span class="ppom-input-option-label ppom-label-checkbox"><?php echo $option_label; ?>
<?php if ( $is_tooltip_enabled && ! empty( $option_tooltip ) ) : ?>
<span data-ppom-tooltip="ppom_tooltip" class="ppom-tooltip" title="<?php echo esc_attr( $option_tooltip ); ?>"><span class="ppom-tooltip-icon" style="background-color:<?php echo esc_attr( $icon_color ); ?>;"></span></span>
<?php endif; ?>
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change adds new frontend behavior (per-option tooltip rendering) but there is no automated coverage validating that the tooltip icon/attributes appear when enabled and are absent when disabled. Since there are existing checkbox e2e specs, please add/update an e2e test to assert tooltip rendering for checkbox options.

Copilot uses AI. Check for mistakes.
@Soare-Robert-Daniel Soare-Robert-Daniel merged commit 93a291b into development Apr 14, 2026
10 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the bugfix/240 branch April 14, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tooltip on Checkbox Options Not Working

4 participants