You are here

function commerce_discount_features_pipe_commerce_discount_alter in Commerce Discount 7

Implements hook_features_pipe_commerce_discount_alter().

Pipe the related Commerce discount order entity.

File

./commerce_discount.module, line 281
Defines the discount and discount offer entities, bundles and functionality.

Code

function commerce_discount_features_pipe_commerce_discount_alter(&$pipe, $data, $export) {
  if (empty($data)) {
    return;
  }
  foreach ($data as $name) {
    $wrapper = entity_metadata_wrapper('commerce_discount', $name);
    $pipe['commerce_discount_offer'][] = $wrapper->commerce_discount_offer->type
      ->value();
  }
}