Fixed tooltip on checbox#559
Merged
Soare-Robert-Daniel merged 4 commits intodevelopmentfrom Apr 14, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_tooltipgate ($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_discountis true: in the discount branch$option_labelis already built with a tooltip HTML fragment (via$tooltip), and then another tooltip is appended in the label output when$option_tooltipis 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_enabledand 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 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; ?> |
There was a problem hiding this comment.
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.
Soare-Robert-Daniel
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added a tooltip to the checkbox options.
Check before Pull Request is ready:
Closes #240