You are here

function uc_order_product_save in Ubercart 8.4

Same name and namespace in other branches
  1. 5 uc_order/uc_order.module \uc_order_product_save()
  2. 6.2 uc_order/uc_order.module \uc_order_product_save()
  3. 7.3 uc_order/uc_order.module \uc_order_product_save()

Save a product to an order.

Parameters

int $order_id: The order id.

\Drupal\uc_order\OrderProductInterface $product: The order product.

2 calls to uc_order_product_save()
Order::postSave in uc_order/src/Entity/Order.php
Acts on a saved entity before the insert or update hook is invoked.
uc_product_kit_uc_order_product_alter in uc_product_kit/uc_product_kit.module
Implements hook_uc_order_product_alter().

File

uc_order/uc_order.module, line 216
Handles all things concerning Ubercart orders.

Code

function uc_order_product_save($order_id, $product) {
  $product->order_id = $order_id;
  return $product
    ->save();
}