Skip navigation
Help

hook_uc_order_product_load

7 uc_order.api.php hook_uc_order_product_load(array $order_products)

Acts on order products being loaded from the database.

This hook is invoked during order product loading, which is handled by entity_load(), via the EntityCRUDController.

Parameters

array $order_products: An array of order product entities being loaded, keyed by id.

See also

hook_entity_load()

Related topics

File

ubercart/uc_order/uc_order.api.php, line 418
Hooks provided by the Order module.

Code

function hook_uc_order_product_load(array $order_products) {
  $result = db_query('SELECT pid, foo FROM {mytable} WHERE pid IN(:ids)', array(':ids' => array_keys($entities)));
  foreach ($result as $record) {
    $entities[$record->pid]->foo = $record->foo;
  }
}