Skip navigation
Help

hook_uc_product_models

6 hooks.php hook_uc_product_models($nid)
7 uc_product.api.php hook_uc_product_models($nid)

Notifies core of any SKUs your module adds to a given node.

NOTE: DO NOT map the array keys, as the possibility for numeric SKUs exists, and this will conflict with the behavior of module_invoke_all(), specifically array_merge_recursive().

Code lifted from uc_attribute.module.

Related topics

1 function implements hook_uc_product_models()

1 invocation of hook_uc_product_models()

File

ubercart/uc_product/uc_product.api.php, line 171
Hooks provided by the Product module.

Code

function hook_uc_product_models($nid) {
  // Get all the SKUs for all the attributes on this node.
  $models = db_query("SELECT DISTINCT model FROM {uc_product_adjustments} WHERE nid = :nid", array(':nid' => $nid))->fetchCol();

  return $models;
}