You are here

public function UnitedKingdomVat::buildZones in Commerce Core 8.2

Builds the tax zones.

Return value

\Drupal\commerce_tax\TaxZone[] The tax zones, keyed by ID.

Overrides LocalTaxTypeBase::buildZones

File

modules/tax/src/Plugin/Commerce/TaxType/UnitedKingdomVat.php, line 33

Class

UnitedKingdomVat
Provides the United Kingdom VAT tax type.

Namespace

Drupal\commerce_tax\Plugin\Commerce\TaxType

Code

public function buildZones() {
  $zones['gb'] = new TaxZone([
    'id' => 'gb',
    'label' => $this
      ->t('United Kingdom'),
    'display_label' => $this
      ->t('VAT'),
    'territories' => [
      [
        'country_code' => 'GB',
      ],
      [
        'country_code' => 'IM',
      ],
    ],
    'rates' => [
      [
        'id' => 'standard',
        'label' => $this
          ->t('Standard'),
        'percentages' => [
          [
            'number' => '0.2',
            'start_date' => '2011-01-04',
          ],
        ],
        'default' => TRUE,
      ],
      [
        'id' => 'reduced',
        'label' => $this
          ->t('Reduced'),
        'percentages' => [
          [
            'number' => '0.05',
            'start_date' => '1997-09-01',
          ],
        ],
      ],
      [
        'id' => 'zero',
        'label' => $this
          ->t('Zero'),
        'percentages' => [
          [
            'number' => '0',
            'start_date' => '1973-01-01',
          ],
        ],
      ],
    ],
  ]);
  return $zones;
}