Index: uc_order/uc_order.ca.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/uc_order/uc_order.ca.inc,v retrieving revision 1.1.2.23 diff -u -r1.1.2.23 uc_order.ca.inc --- uc_order/uc_order.ca.inc 15 Jun 2009 19:52:26 -0000 1.1.2.23 +++ uc_order/uc_order.ca.inc 11 Jul 2009 21:14:22 -0000 @@ -527,7 +527,7 @@ function uc_order_condition_has_products($order, $settings) { $products = array(); foreach ($order->products as $product) { - $products[] = $product->nid; + $products[] = $product->model; } $required = array_intersect($settings['products'], $products); if ($settings['required']) { @@ -563,13 +563,15 @@ ), '#default_value' => $settings['forbidden'], ); + $options = array(); - $result = db_query("SELECT nid, model FROM {uc_products}"); + $result = db_query("SELECT nid FROM {uc_products}"); while ($product = db_fetch_object($result)) { - $options[$product->nid] = $product->model; + $options += uc_product_get_models(node_load($product), FALSE); } + $form['products'] = array('#type' => 'select', - '#title' => t('Products'), + '#title' => t('Product models'), '#options' => $options, '#default_value' => $settings['products'], '#multiple' => TRUE, Index: uc_product/uc_product.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/uc_product/uc_product.module,v retrieving revision 1.14.2.28 diff -u -r1.14.2.28 uc_product.module --- uc_product/uc_product.module 8 Jul 2009 12:56:51 -0000 1.14.2.28 +++ uc_product/uc_product.module 11 Jul 2009 21:14:22 -0000 @@ -1592,13 +1597,19 @@ /** * Get all models of a product (node). * - * @param $nid - * The node ID of the product. - * * Add the generic 'Any' option and the node SKU, then gather any modules' * models on this node. + * + * @param $nid + * The node ID of the product. + * @param $add_blank + * String to use for the initial blank entry. If not desired, set to NULL + * or FALSE. This function calls t() to translate the string given. Defaults + * to 'Any'. + * @return + * Returns */ -function uc_product_get_models($node) { +function uc_product_get_models($node, $add_blank = 'Any') { // Get any modules' SKUs on this node. $models = module_invoke_all('uc_product_models', $node); // Add the base SKU of the node. @@ -1610,7 +1621,11 @@ asort($models); // And finally, we prepend 'Any' so it's the first option. - return array(NULL => 'Any') + $models; + if (!empty($add_blank)) { + return array('' => t($add_blank)) + $models; + } + + return $models; } /**