Still applies on 1.6.
The SKU's are loaded from uc_product_adjustments table.
The weights are stored in uc_product_options table.
So, I want this...:
function uc_stock_skus($nid) {
$node = node_load($nid);
if (is_null($node->model)) {
return FALSE;
}
$skus = array($node->model);
if (module_exists('uc_attribute')) {
$models = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = %d", $node->nid);
while ($model = db_fetch_object($models)) {
if (!in_array($model->model, $skus)) {
$skus[] = $model->model;
}
}
}
return $skus;
}
...to return the array sorted by the "weight" column of the uc_product_options table.
It's very strange to have the options displayed in the order of inserting, not in the order of option weights.


