Jump to content



Latest News: (loading..)

- - - - -

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


This topic has been archived. This means that you cannot reply to this topic.
21 replies to this topic

#21   roneada

roneada
  • Members
  • 32 posts

Posted 14 April 2012 - 12:31 PM

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

#22   14steve14

14steve14

    STORE OWNER NOT CODER

  • Members
  • 3,085 posts

Posted 14 April 2012 - 01:29 PM

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, so dont bother sending PMs asking for help as you wont get any.  

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.