You are here

protected function LocalTaxTypeBase::resolveZones in Commerce Core 8.2

Resolves the tax zones for the given order item and customer profile.

Parameters

\Drupal\commerce_order\Entity\OrderItemInterface $order_item: The order item.

\Drupal\profile\Entity\ProfileInterface $customer_profile: The customer profile. Contains the address and tax number.

Return value

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

2 calls to LocalTaxTypeBase::resolveZones()
CanadianSalesTax::resolveZones in modules/tax/src/Plugin/Commerce/TaxType/CanadianSalesTax.php
Resolves the tax zones for the given order item and customer profile.
LocalTaxTypeBase::resolveRates in modules/tax/src/Plugin/Commerce/TaxType/LocalTaxTypeBase.php
Resolves the tax rates for the given order item and customer profile.
2 methods override LocalTaxTypeBase::resolveZones()
CanadianSalesTax::resolveZones in modules/tax/src/Plugin/Commerce/TaxType/CanadianSalesTax.php
Resolves the tax zones for the given order item and customer profile.
EuropeanUnionVat::resolveZones in modules/tax/src/Plugin/Commerce/TaxType/EuropeanUnionVat.php
Resolves the tax zones for the given order item and customer profile.

File

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

Class

LocalTaxTypeBase
Provides the base class for local tax types.

Namespace

Drupal\commerce_tax\Plugin\Commerce\TaxType

Code

protected function resolveZones(OrderItemInterface $order_item, ProfileInterface $customer_profile) {
  $customer_address = $customer_profile
    ->get('address')
    ->first();
  $resolved_zones = $this
    ->getMatchingZones($customer_address);
  return $resolved_zones;
}