Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC Product Attribute Radio Selection - default top problem!


Eprime

Recommended Posts

Hello all,

 

I have installed the following contributions:

 

http://www.oscommerce.com/forums/index.php?showtopic=123629

 

(Sorting the order of the product's attributes based on price)

 

and

 

http://www.oscommerce.com/community/contri...ll/search,radio

 

(Making it so that the attributes are radio buttons instead of a drop down selection)

 

However, it seems like the radio attribute automatically chooses the bottom first selection instead of the default top one. I know this is a simple fix in PHP, but Im a bit stumped.

 

I believe it lies somewhere in this code:

 

////
// 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 . '"';
	$field .= ' checked';

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

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

return $field;
 }

////

 

Would anyone have a clue?

Edited by Eprime
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...