You are here

public function ChainTaxCodeResolver::resolve in Drupal Commerce Connector for AvaTax 8

Resolves the tax code of a given order item..

Parameters

\Drupal\commerce_order\Entity\OrderItemInterface $order_item: The purchaseable entity.

Return value

string The tax code.

Overrides TaxCodeResolverInterface::resolve

File

src/Resolver/ChainTaxCodeResolver.php, line 46

Class

ChainTaxCodeResolver
Provides the chain tax code resolver.

Namespace

Drupal\commerce_avatax\Resolver

Code

public function resolve(OrderItemInterface $order_item) {
  foreach ($this->resolvers as $resolver) {
    $result = $resolver
      ->resolve($order_item);
    if ($result) {
      return $result;
    }
  }
}