You are here

function hook_uc_order_product_load in Ubercart 8.4

Same name and namespace in other branches
  1. 7.3 uc_order/uc_order.api.php \hook_uc_order_product_load()

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()

File

uc_order/uc_order.api.php, line 127
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[])', [
    ':ids[]' => array_keys($entities),
  ]);
  foreach ($result as $record) {
    $entities[$record->pid]->foo = $record->foo;
  }
}