Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

attribute list expanded on prod info page


carie

Recommended Posts

Posted

I want my products attributes to show as an expanded list rather than a pull down. I assume it is in cat/prod_info.php and where it says draw_pull_down_menu I change it to what?

 

carie

Posted
I want my products attributes to show as an expanded list rather than a pull down. I assume it is in cat/prod_info.php and where it says draw_pull_down_menu I change it to what?

 

carie

 

That is the function it calls, you can open up cart/includes/functions/html_output.php and take a look I use radio buttons myself so I put

// Output a form radio menu for product info page
 function tep_draw_radio_menu($name, $values, $default = '', $parameters = '', $required = false) {
$field ='<table border="0" cellspacing="0" cellpadding="0"><tr><td class="main">';   
if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

for ($i=0, $n=sizeof($values); $i<$n; $i++) {
$value = tep_output_string($values[$i]['id']);
$field .= '<input type="radio" name="' . $name . '" value="' . $value . '"';
	if ($i == 0) $field .= ' checked';

  $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</br>';
}
$field .= '</td></tr></table>';

if ($required == true) $field .= TEXT_FIELD_REQUIRED;

return $field;
 }

In the output file then in the product_info.php I put

<?php echo tep_draw_radio_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...