You are here

protected function LocalTaxTypeBase::matchesRegistrations in Commerce Core 8.2

Checks whether the tax type matches the store's tax registrations.

Countries have a yearly transaction threshold (such as $30k) which when breached requires companies to register for tax collection. This also often applies to foreign companies selling to that country's residents. Furthermore, many countries are now trying to make foreign companies collect their tax when selling digital products to their residents, regardless of any threshold. The $store->tax_registrations field allows merchants to precisely specify for which countries they are collecting tax.

Parameters

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

Return value

bool TRUE if the tax type matches the tax registrations, FALSE otherwise.

1 call to LocalTaxTypeBase::matchesRegistrations()
LocalTaxTypeBase::applies in modules/tax/src/Plugin/Commerce/TaxType/LocalTaxTypeBase.php
Checks whether the tax type applies to the given order.
1 method overrides LocalTaxTypeBase::matchesRegistrations()
CanadianSalesTax::matchesRegistrations in modules/tax/src/Plugin/Commerce/TaxType/CanadianSalesTax.php
Checks whether the tax type matches the store's tax registrations.

File

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

Class

LocalTaxTypeBase
Provides the base class for local tax types.

Namespace

Drupal\commerce_tax\Plugin\Commerce\TaxType

Code

protected function matchesRegistrations(StoreInterface $store) {
  foreach ($this
    ->getZones() as $zone) {
    if ($this
      ->checkRegistrations($store, $zone)) {
      return TRUE;
    }
  }
  return FALSE;
}