You are here

public function OrderHasProductClassCondition::productClassOptions in Ubercart 8.4

Options callback.

Return value

array Associative array of all Ubercart product classes indexed by class ID.

File

uc_order/src/Plugin/Condition/OrderHasProductClassCondition.php, line 91

Class

OrderHasProductClassCondition
Provides 'Order has a product with a selected product classes' condition.

Namespace

Drupal\uc_order\Plugin\Condition

Code

public function productClassOptions() {
  $types = uc_product_types();
  $bundle_info = $this->entityTypeBundleInfo
    ->getAllBundleInfo();
  $options = [];
  foreach ($types as $machine_id) {
    $options[$machine_id] = $bundle_info['node'][$machine_id]['label'];
  }
  return $options;
}