PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
← All changes | src/Addons/TierLabels/Frontend/DisplayManager.php +9 -5 6.1.0 → 8.0.2 View file →
@@ -73,9 +73,10 @@
73 73 $CSS = '';
74 74
75 75 // CSS Fixes
76 76 if ( 'blocks' === $layout ) {
77 - if ( in_array( $args['style'], array( 'default', '1', '2', '4' ) ) ) {
77 + // styles with a floating label above the block (5 and 7 are card styles like the default)
78 + if ( in_array( $args['style'], array( 'default', '1', '2', '4', '5', '7' ) ) ) {
78 79 $CSS .= "#{$args['id']} { gap: 20px 10px }";
79 80 $CSS .= "#{$args['id']} .tiered-pricing-block { position: relative; }";
80 81 $CSS .= "#{$args['id']} .tiered-pricing-tier-label {margin: 0 !important;
81 82 position: absolute;
@@ -85,9 +86,9 @@
85 86 text-transform: uppercase;
86 87 z-index: 20;}";
87 88 }
88 89
89 - if ( in_array( $args['style'], array( 'default', '2', '4' ) ) ) {
90 + if ( in_array( $args['style'], array( 'default', '2', '4', '5', '7' ) ) ) {
90 91 $CSS .= "#{$args['id']} .tiered-pricing-block:has(#" . $label->getId() . ") { padding-top: 12px; }";
91 92 }
92 93
93 94 if ( $args['style'] === '1' ) {
@@ -94,11 +95,13 @@
94 95 $CSS .= "#{$args['id']} .tiered-pricing-block:has(#" . $label->getId() . ") {overflow: unset !important;}";
95 96 $CSS .= "#{$args['id']} .tiered-pricing-block:has(#" . $label->getId() . ") .tiered-pricing-block__quantity {padding-top: 12px !important;}";
96 97 }
97 98 } elseif ( 'table' === $layout ) {
98 - $CSS .= ".tiered-pricing-table .tiered-pricing-tier-label { margin-left: 5px; }";
99 + $CSS .= "#{$args['id']} tbody td:has(#" . $label->getId() . ") { display: flex; align-items: center; gap: 5px; }";
99 100 } elseif ( 'plain-text' === $layout ) {
100 - $CSS .= ".tiered-pricing-plain-text:has(#" . $label->getId() . ") {display:flex; align-items: center; gap: 5px; }";
101 + // the "one line" style keeps its tiers inline
102 + $display = '2' === (string) $args['style'] ? 'inline-flex' : 'flex';
103 + $CSS .= "#{$args['id']} .tiered-pricing-plain-text:has(#" . $label->getId() . ") { display: {$display}; align-items: center; gap: 5px; }";
101 104 }
102 105
103 106 if ( $CSS ) {
104 107 ?>
@@ -107,7 +110,8 @@
107 110 </style>
108 111 <?php
109 112 }
110 113
111 - echo wp_kses_post( $label->render() );
114 + // Output is escaped internally in TierLabel::render()
115 + echo $label->render(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
112 116 }
113 117 }