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;
  }
}

Comments

tr’s picture

Title: UC Product Kit: products not sorted properly » Product Kit: products not sorted properly
Version: 6.x-2.2 » 6.x-2.x-dev
Component: Code » Product kits

Moving to "Product kit" component.

longwave’s picture

Status: Active » Fixed

Fixed in both branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.