You are here

protected function TaxTypeBase::getTaxableType in Commerce Core 8.2

Gets the taxable type for the given order item.

Parameters

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

Return value

string The taxable type, a \Drupal\commerce_tax\TaxableType constant.

1 call to TaxTypeBase::getTaxableType()
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/TaxTypeBase.php, line 225

Class

TaxTypeBase
Provides the base class for tax types.

Namespace

Drupal\commerce_tax\Plugin\Commerce\TaxType

Code

protected function getTaxableType(OrderItemInterface $order_item) {

  // @todo Allow the taxable type to be specified on the product type too.
  $order_item_type_storage = $this->entityTypeManager
    ->getStorage('commerce_order_item_type');
  $order_item_type = $order_item_type_storage
    ->load($order_item
    ->bundle());
  $taxable_type = $order_item_type
    ->getThirdPartySetting('commerce_tax', 'taxable_type', TaxableType::getDefault());
  return $taxable_type;
}