You are here

public function CombinationOffer::getOffers in Commerce Core 8.2

Gets the offers configured.

Return value

\Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer\PromotionOfferInterface[] The offers configured.

Overrides CombinationOfferInterface::getOffers

1 call to CombinationOffer::getOffers()
CombinationOffer::apply in modules/promotion/src/Plugin/Commerce/PromotionOffer/CombinationOffer.php
Applies the offer to the given entity.

File

modules/promotion/src/Plugin/Commerce/PromotionOffer/CombinationOffer.php, line 264

Class

CombinationOffer
Provides the 'combination_offer' offer plugin.

Namespace

Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer

Code

public function getOffers() {
  $offers = [];
  foreach ($this->configuration['offers'] as $offer) {
    $offers[] = $this->offerManager
      ->createInstance($offer['target_plugin_id'], $offer['target_plugin_configuration']);
  }
  return $offers;
}