You are here

public function StoreTax::getDefaultZones in Commerce Core 8.2

Gets the default tax zones for the given store.

Parameters

\Drupal\commerce_store\Entity\StoreInterface $store: The store.

Return value

\Drupal\commerce_tax\TaxZone[] The tax zones.

Overrides StoreTaxInterface::getDefaultZones

1 call to StoreTax::getDefaultZones()
StoreTax::getDefaultRates in modules/tax/src/StoreTax.php
Gets the default tax rates for the given store and order item.

File

modules/tax/src/StoreTax.php, line 88

Class

StoreTax

Namespace

Drupal\commerce_tax

Code

public function getDefaultZones(StoreInterface $store) {
  $tax_type = $this
    ->getDefaultTaxType($store);
  if (!$tax_type) {
    return [];
  }

  /** @var \Drupal\commerce_tax\Plugin\Commerce\TaxType\LocalTaxTypeInterface $tax_type_plugin */
  $tax_type_plugin = $tax_type
    ->getPlugin();
  $zones = $tax_type_plugin
    ->getMatchingZones($store
    ->getAddress());
  return $zones;
}