You are here

function _get_adjustment_models in Ubercart 5

Return a list of model adjustments for a given product node

@return: An associative array containing the models created by different product attributes or FALSE if none exist.

Parameters

$nid: The product node id

1 call to _get_adjustment_models()
uc_file_feature_form in uc_file/uc_file.module
Form builder for hook_product_feature

File

uc_file/uc_file.module, line 1394
Allows products to be associated with downloadable files.

Code

function _get_adjustment_models($nid) {
  $models = array();
  if (module_exists('uc_attribute')) {
    $adjustments = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = %d", $nid);
    while ($adjustment = db_fetch_object($adjustments)) {
      if (!in_array($adjustment->model, $models)) {
        $models[$adjustment->model] = $adjustment->model;
      }
    }
  }
  return empty($models) ? FALSE : $models;
}