...

View Full Version : default value in product options (oscommerce)



scott_white85
09-09-2011, 07:17 AM
this is the existing product options see image below:
http://www.flotech.com.sg/delete/select.jpg



i want to delete the "please select" and make the "LWIZ" as default. i tried already to set the sort value to zero but nothing happened. see image below

http://www.flotech.com.sg/delete/lwiz.jpg
http://www.flotech.com.sg/delete/sort.jpg

NOTE: not just for LWIZ i want to remove all the "please select" to all product options and make the first option as default.



here's the code for the form



<?php
$selectname[] = 'id[' . $products_options_name['options_id'] . ']';
echo '<tr>
<td width="125">' . tep_options_name($products_options_name['options_id']) . '</td>
<td id="div' . $products_options_name['options_id'] . '"><select name="id[' . $products_options_name['options_id'] . ']" id="id[' . $products_options_name['options_id'] . ']" style="width:500px;" onchange="checkdep(\'select\', \'' . $products_options_name['options_id'] . '\')">
<option value="0" style="background-color:#ffcccc;">Please Select</option>';

$products_options_query = tep_db_query("select options_values_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and options_id = '" . $products_options_name['options_id'] . "' order by attribute_sort");
while($products_options = tep_db_fetch_array($products_options_query)) {
$options_values_price = '';
if ($products_options['options_values_price'] != '0') {
$options_values_price .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
}
echo '<option value="'.$products_options['options_values_id'].'">' . tep_values_name($products_options['options_values_id']) . $options_values_price . '</option>';
}
echo '</select> <span style="color:#ff0000;text-decoration:underline;" onmouseover="this.style.cursor=\'pointer\'" onclick="checkdep(\'reset\', \'' . $products_options_name['options_id'] . '\')"><img src="images/btn_reset.gif" border="0" align="top"></span>';
echo ' </td>
</tr>';
}
?>

>ssp-cdr<
09-09-2011, 07:12 PM
Simply remove this text from the code.
<option value="0" style="background-color:#ffcccc;">Please Select</option>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum