Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Remove the product attribute drop-down box if only one attribute


21 replies to this topic

#21 roneada

  • Community Member
  • 25 posts
  • Real Name:Ronmorales
  • Gender:Male

Posted 14 April 2012, 12:31

i have the remove dropdown menu with radio buttons, but your solutions not work, how to have for remove the dropdown? thanks!

#22 14steve14

  • Community Member
  • 2,171 posts
  • Real Name:Steve
  • Gender:Male

Posted 14 April 2012, 13:29

To get radio buttons working you need to add to your includes/functions/general.php

////
// Output a form radio menu for product info page maniac101
  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('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '<br />';
    }
    $field .= '</td></tr></table>';
    if ($required == true) $field .= TEXT_FIELD_REQUIRED;
    return $field;
  }

Then in your products_info.php change

tep_draw_pull_down_menu

to

tep_draw_radio_menu
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder. OSC has a steep learning curve, but in general the program does work. If it doesnt work, the chances are it is something you have done.