--- uc_attribute.module +++ (clipboard) @@ -550,7 +563,7 @@ foreach ($data['attributes'] as $aid => $oid) { $attribute = $node->attributes[$aid]; // Only discrete options can affect the price of an item. - if ($attribute->display && count($attribute->options)) { + if (in_array($attribute->display, array(1, 2)) && count($attribute->options)) { $options[$aid] = (array)$attribute->options[$oid]; $options[$aid]['attribute'] = _uc_attribute_get_name($attribute); } @@ -640,7 +653,7 @@ $options[$option->oid] .= $display_price; } - if (count($attribute->options) && $attribute->display > 0) { + if (count($attribute->options) && in_array($attribute->display, array(1, 2))) { if ($attribute->required) { if ($attribute->display == 1) { $options = array('' => t('Please select')) + $options; @@ -657,7 +670,7 @@ } else { $form_attributes[$attribute->aid] = array( - '#type' => 'textfield', + '#type' => $attribute->display == 0 ? 'textfield' : 'textarea', '#description' => check_markup($attribute->description), '#default_value' => $attribute->required == FALSE ? $attribute->options[$attribute->default_option]->name : '', '#required' => $attribute->required, @@ -680,6 +693,7 @@ 0 => t('Text field'), 1 => t('Select box'), 2 => t('Radio buttons'), + 3 => t('Text area (multiple rows)'), ); } @@ -692,7 +706,7 @@ * Array of attribute ids that have price affecting options. */ function uc_attribute_priced_attributes($nid) { - $attributes = db_query("SELECT DISTINCT (pa.aid) FROM {uc_product_attributes} AS pa INNER JOIN {uc_attribute_options} AS ao ON ao.aid = pa.aid INNER JOIN {uc_product_options} AS po ON (po.oid = ao.oid AND po.nid = pa.nid) WHERE pa.nid = %d AND po.price <> 0 AND pa.display <> 0", $nid); + $attributes = db_query("SELECT DISTINCT (pa.aid) FROM {uc_product_attributes} AS pa INNER JOIN {uc_attribute_options} AS ao ON ao.aid = pa.aid INNER JOIN {uc_product_options} AS po ON (po.oid = ao.oid AND po.nid = pa.nid) WHERE pa.nid = %d AND po.price <> 0 AND (pa.display = 1 OR pa.display = 2)", $nid); $aids = array(); while ($attribute = db_fetch_array($attributes)) { $aids[] = $attribute['aid'];