Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    25
    Thanks
    5
    Thanked 0 Times in 0 Posts

    default value in product options (oscommerce)

    this is the existing product options see image below:




    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




    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 Code:

    <?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>'
    ;
            }
    ?>
    Last edited by scott_white85; 09-09-2011 at 06:21 AM.

  • #2
    Regular Coder
    Join Date
    May 2007
    Posts
    100
    Thanks
    16
    Thanked 11 Times in 11 Posts
    Simply remove this text from the code.
    Code:
    <option value="0" style="background-color:#ffcccc;">Please Select</option>

  • Users who have thanked >ssp-cdr< for this post:

    scott_white85 (09-12-2011)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •