protected function ProductBundleItem::getEnabledVariations in Commerce Product Bundle 8
Get the enabled product variations.
Return value
null|\Drupal\commerce_product\Entity\ProductVariationInterface[] Array of enabled product variations or NULL.
Throws
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
1 call to ProductBundleItem::getEnabledVariations()
- ProductBundleItem::getVariations in src/
Entity/ ProductBundleItem.php - Gets the product variations limited by the bundle item or enabled on the product.
File
- src/
Entity/ ProductBundleItem.php, line 422
Class
- ProductBundleItem
- Defines the product bundle item entity.
Namespace
Drupal\commerce_product_bundle\EntityCode
protected function getEnabledVariations() {
$variationStorage = $this
->entityTypeManager()
->getStorage('commerce_product_variation');
return $variationStorage
->loadEnabled($this
->getProduct());
}