You are here

function uc_attribute_node_load in Ubercart 7.3

Same name and namespace in other branches
  1. 8.4 uc_attribute/uc_attribute.module \uc_attribute_node_load()

Implements hook_node_load().

File

uc_attribute/uc_attribute.module, line 357
Ubercart Attribute module.

Code

function uc_attribute_node_load($nodes, $types) {
  $product_types = array_intersect(uc_product_types(), $types);
  if (empty($product_types)) {
    return;
  }
  foreach ($nodes as &$node) {
    if (uc_product_is_product($node->type)) {
      $attributes = uc_product_get_attributes($node->nid);
      if (is_array($attributes) && !empty($attributes)) {
        $node->attributes = $attributes;
      }
    }
  }
}