You are here

public function UcCartItemController::attachLoad in Ubercart 7.3

Overrides EntityAPIController::attachLoad().

Overrides DrupalDefaultEntityController::attachLoad

File

uc_cart/uc_cart.controller.inc, line 13
Contains the controller for uc_cart_item entities.

Class

UcCartItemController
@file Contains the controller for uc_cart_item entities.

Code

public function attachLoad(&$items, $revision_id = FALSE) {
  foreach ($items as &$item) {
    $product = uc_product_load_variant($item->nid, $item->data);

    // Merge in fields from the product.
    foreach ($product as $key => $value) {
      $item->{$key} = $value;
    }
    $item->module = $item->data['module'];
  }
  parent::attachLoad($items, $revision_id);
}