hook_alloc_get_items

Definition

hook_alloc_get_items($txn)
ecommerce-5--4/docs/developer/hooks/ec_receipt.php, line 319

Description

The allocation object provider returns the items of the allocation object. Eg. store returns the product items from the transaction object.

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
function hook_alloc_get_items($txn) {
  if (!empty($txn->items) && is_array($txn->items)) {
    store_alloc_build_items($txn, 'init');
    $items = array_map('store_alloc_build_items', $txn->items);
    return $items;
  }
}
?>