You are here

public function ProductBundle::getOrderItemTypeId in Commerce Product Bundle 8

Gets the purchasable entity's order item type ID.

Used for finding/creating the appropriate order item when purchasing a product (adding it to an order).

Return value

string The order item type ID.

Overrides PurchasableEntityInterface::getOrderItemTypeId

File

src/Entity/ProductBundle.php, line 171

Class

ProductBundle
Defines the product bundle entity.

Namespace

Drupal\commerce_product_bundle\Entity

Code

public function getOrderItemTypeId() {

  // The order item type is a bundle-level setting.
  $type_storage = $this
    ->entityTypeManager()
    ->getStorage('commerce_product_bundle_type');
  $type_entity = $type_storage
    ->load($this
    ->bundle());
  return $type_entity
    ->getOrderItemTypeId();
}