| @@ -155,12 +155,21 @@ | ||
| 155 | 155 | |
| 156 | 156 | add_action('fluent_cart/checkout/prepare_other_data', [$this, 'prepareOtherData'], 10, 1); |
| 157 | 157 | |
| 158 | 158 | add_action('fluent_cart/product/after_price', function ($data) { |
| 159 | - if (Arr::get($data, 'scope') === 'price_range') { | |
| 159 | + $variant = Arr::get($data, 'variant', null); | |
| 160 | + | |
| 161 | + // scope 'price_range' covers two cases: a single confirmed price | |
| 162 | + // for a simple product (variant is set — resolve its suffix | |
| 163 | + // normally) and the non-simple price summary (min/max, or a | |
| 164 | + // single value when every variant is priced the same — variant | |
| 165 | + // is always null there, deliberately skipped since no single | |
| 166 | + // tax_inclusion applies to a multi-variant summary; see | |
| 167 | + // PR #1767/#2271). | |
| 168 | + if (Arr::get($data, 'scope') === 'price_range' && !$variant) { | |
| 160 | 169 | return; |
| 161 | 170 | } |
| 162 | - $variant = Arr::get($data, 'variant', null); | |
| 171 | + | |
| 163 | 172 | $priceSuffix = $this->resolvePriceSuffix($variant); |
| 164 | 173 | $variantInclusion = $variant ? Arr::get($variant->other_info ?: [], 'tax_inclusion', '') : ''; |
| 165 | 174 | $taxInclusion = $variantInclusion ?: Arr::get($this->taxSettings, 'tax_inclusion', ''); |
| 166 | 175 | |