You are here

protected function LocalTaxTypeBase::checkRegistrations in Commerce Core 8.2

Checks whether the store is registered to collect taxes in the given zone.

Parameters

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

\Drupal\commerce_tax\TaxZone $zone: The tax zone.

Return value

bool TRUE if the store is registered in the given zone, FALSE otherwise.

2 calls to LocalTaxTypeBase::checkRegistrations()
EuropeanUnionVat::resolveZones in modules/tax/src/Plugin/Commerce/TaxType/EuropeanUnionVat.php
Resolves the tax zones for the given order item and customer profile.
LocalTaxTypeBase::matchesRegistrations in modules/tax/src/Plugin/Commerce/TaxType/LocalTaxTypeBase.php
Checks whether the tax type matches the store's tax registrations.

File

modules/tax/src/Plugin/Commerce/TaxType/LocalTaxTypeBase.php, line 215

Class

LocalTaxTypeBase
Provides the base class for local tax types.

Namespace

Drupal\commerce_tax\Plugin\Commerce\TaxType

Code

protected function checkRegistrations(StoreInterface $store, TaxZone $zone) {
  foreach ($store
    ->get('tax_registrations') as $field_item) {
    if ($zone
      ->match(new Address($field_item->value))) {
      return TRUE;
    }
  }
  return FALSE;
}