Skip navigation
Help

hook_uc_order_product_insert

7 uc_order.api.php hook_uc_order_product_insert(object $order_product)

Responds when an order product is inserted.

This hook is invoked after the order product is inserted into the database.

Parameters

object $order_product: The order product that is being inserted.

See also

hook_entity_insert()

Related topics

File

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

Code

function hook_uc_order_product_insert(object $order_product) {
  db_insert('mytable')
    ->fields(array(
    'id' => entity_id('uc_order_product', $order_product), 
    'extra' => print_r($order_product, TRUE),
  ))
    ->execute();
}