| @@ -37,9 +37,10 @@ | ||
| 37 | 37 | { |
| 38 | 38 | $vatNumber = Arr::get($checkoutData, 'tax_data.vat_number', ''); |
| 39 | 39 | $isValid = Arr::get($checkoutData, 'tax_data.valid', false); |
| 40 | 40 | $isRequired = CheckoutFieldsSchema::isVatNumberRequired(); |
| 41 | - $isB2BActive = Arr::get($checkoutData, 'form_data.is_business', 'no') === 'yes'; | |
| 41 | + $isB2BActive = Arr::get($checkoutData, 'form_data.is_business', 'no') === 'yes' | |
| 42 | + || CheckoutFieldsSchema::isB2BOnlyMode(); | |
| 42 | 43 | $isEuCountry = TaxModule::isTaxEnabled() |
| 43 | 44 | && $this->taxApplicableCountry |
| 44 | 45 | && LocalizationManager::getInstance()->isEuTaxCountry($this->taxApplicableCountry); |
| 45 | 46 | ?> |
| @@ -61,12 +62,12 @@ | ||
| 61 | 62 | aria-describedby="fct_billing_tax_id_error" |
| 62 | 63 | <?php if ($isRequired): ?> data-b2b-required="yes"<?php endif; ?> |
| 63 | 64 | aria-required="<?php echo ($isRequired && $isB2BActive) ? 'true' : 'false'; ?>" |
| 64 | 65 | <?php if ($isRequired && $isB2BActive): ?> required<?php endif; ?> |
| 65 | - <?php echo ($isValid && TaxModule::canApplyReverseCharge($this->taxApplicableCountry)) ? 'readonly' : ''; ?> | |
| 66 | + <?php echo ($isValid && $isEuCountry) ? 'readonly' : ''; ?> | |
| 66 | 67 | /> |
| 67 | 68 | |
| 68 | - <?php if ($isEuCountry && TaxModule::canApplyReverseCharge($this->taxApplicableCountry)): ?> | |
| 69 | + <?php if ($isEuCountry): ?> | |
| 69 | 70 | <?php if ($isValid): ?> |
| 70 | 71 | <button |
| 71 | 72 | type="button" |
| 72 | 73 | data-fluent-cart-tax-remove-btn |
| @@ -107,12 +108,11 @@ | ||
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | public function renderValidNote($checkoutData) |
| 110 | 111 | { |
| 111 | - $isValid = Arr::get($checkoutData, 'tax_data.valid', false); | |
| 112 | - $name = Arr::get($checkoutData, 'tax_data.name', ''); | |
| 113 | - $taxTotal = Arr::get($checkoutData, 'tax_data.tax_total', 0); | |
| 114 | - $declarationNote = sanitize_text_field(Arr::get($checkoutData, 'tax_data.declaration_note', '')); | |
| 112 | + $isValid = Arr::get($checkoutData, 'tax_data.valid', false); | |
| 113 | + $name = Arr::get($checkoutData, 'tax_data.name', ''); | |
| 114 | + $taxTotal = Arr::get($checkoutData, 'tax_data.tax_total', 0); | |
| 115 | 115 | ?> |
| 116 | 116 | <div |
| 117 | 117 | class="fct_vat_valid_note <?php echo !$isValid ? 'is-hidden' : ''; ?>" |
| 118 | 118 | data-fluent-cart-tax-valid-note-wrapper |
| @@ -125,21 +125,8 @@ | ||
| 125 | 125 | <span class="fct_vat_reverse_charge_warning"> |
| 126 | 126 | <?php echo esc_html__('(Reverse Charge not applied)', 'fluent-cart'); ?> |
| 127 | 127 | </span> |
| 128 | 128 | <?php endif; ?> |
| 129 | - | |
| 130 | - <div class="fct_vat_declaration_note_wrapper"> | |
| 131 | - <textarea | |
| 132 | - id="fct_vat_declaration_note" | |
| 133 | - name="fct_vat_declaration_note" | |
| 134 | - data-fluent-cart-vat-declaration-note | |
| 135 | - maxlength="255" | |
| 136 | - rows="2" | |
| 137 | - placeholder="<?php echo esc_attr__('e.g. I confirm reverse charge applies — VAT will be self-accounted in my country. Saved with your order. Max 255 characters. ', 'fluent-cart'); ?>" | |
| 138 | - aria-label="<?php echo esc_attr__('Reverse Charge Declaration', 'fluent-cart'); ?>" | |
| 139 | - aria-describedby="fct_vat_declaration_note_hint" | |
| 140 | - ><?php echo esc_textarea($declarationNote); ?></textarea> | |
| 141 | - </div> | |
| 142 | 129 | </div> |
| 143 | 130 | <?php |
| 144 | 131 | } |
| 145 | 132 | } |