sackstein
11-05-2010, 12:59 AM
I am using oscommerce for a shopping cart site and I am having a problem on a page that requires 2 drop downs. they are for sizing on a garment.
There needs to be 2 drop downs one for regular sizes and one for tall and the user has to pick between the two. I have this working now but the initial value of each drop down is not something like "please select one" it is the actual price for both so that is causing a conflict because there is no way to just choose one.
What I ended up trying to do was add in a null value to be initially selected on both drop downs with text saying "please select one"
here is the original:
<tr>
<td class="option_names"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
</tr>
And here it is modified to initially display the please select text:
<tr>
<td class="option_names"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
<td class="main"><?php
if ($products_options_name['products_options_id'] = 2 ) {
echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', array_merge(array(array('id'=>null, 'text'=>'Please Select One '. $selected_attribute)), $products_options_array));
}
else {
echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute);
}
?></td>
</tr>
The problem oscommerce is having with this is that when the user tries to add to his cart, it ends up showing no sizing for both and just taking the null value i suppose.
Is there anything I can do to avoid this?
There needs to be 2 drop downs one for regular sizes and one for tall and the user has to pick between the two. I have this working now but the initial value of each drop down is not something like "please select one" it is the actual price for both so that is causing a conflict because there is no way to just choose one.
What I ended up trying to do was add in a null value to be initially selected on both drop downs with text saying "please select one"
here is the original:
<tr>
<td class="option_names"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
</tr>
And here it is modified to initially display the please select text:
<tr>
<td class="option_names"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
<td class="main"><?php
if ($products_options_name['products_options_id'] = 2 ) {
echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', array_merge(array(array('id'=>null, 'text'=>'Please Select One '. $selected_attribute)), $products_options_array));
}
else {
echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute);
}
?></td>
</tr>
The problem oscommerce is having with this is that when the user tries to add to his cart, it ends up showing no sizing for both and just taking the null value i suppose.
Is there anything I can do to avoid this?