Attached screenshot has the help text for the "List Position" field (aka ordering column in the db), which claims that an alphabetical sort will be used as backup.
When showing a list of products in a product kit, the following relevant functions are used. The initial query is clear only sorted by the list position, and the uasort callback does the same.
function uc_product_kit_load(&$node) {
...
$result = db_query("SELECT product_id, mutable, qty, discount, ordering, synchronized FROM {uc_product_kits} WHERE vid = %d ORDER BY ordering", $node->vid);
...
uasort($products, '_uc_product_kit_sort_products');
$obj->products = $products;
...
return $obj;
}
function _uc_product_kit_sort_products($a, $b) {
if ($a->ordering == $b->ordering) {
return 0;
}
else {
return ($a->ordering < $b->ordering) ? -1 : 1;
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| Screen shot 2010-01-06 at 5.44.09 PM.png | 11.29 KB | kscheirer |
Comments
Comment #1
tr commentedMoving to "Product kit" component.
Comment #2
longwaveFixed in both branches.