I understand the 'switch', I actually read up on it yesterday and did quite a bit of trying it out. Now I placed the variable flag like mentioned, I even put one in every case, here's a sample:
Code:
// radio buttons
case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_RADIO):
if ($show_attributes_qty_prices_icon == 'true') {
$options_name[] = ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'];
} else {
$options_name[] = $products_options_names->fields['products_options_name'];
}
$options_menu[] = $tmp_radio . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
$options_type[] = "radio";
break;
and then I used the code in tpl_module_attributes to see what the output was:
Code:
<div class="wrapperAttribsOptions">
<?php echo $options_type[$i];?>
that worked well and it was good to see what was going on, like seeing that my attempt at a hidden type actually output a dropdown converted to a radio button(default case I think), probably because my code was not right. I was actually trying to output the type of option yesterday but was trying to pull the variable from elsewhere and it wasn't working. Anyway I reverted my modules/attributes.php to original, added the flags, reverted to radio button options in the admin, and things started to output as they should without modifications.
After checking everything I placed this conditional in the tpl_module_attributes:
Code:
<?php if ($options_menu == 'radio'){
$class = 'hideme';
} else {
$class = 'styled-select';
}
?>
<div class="<?php echo $class; ?>" ><?php echo "\n" . $options_menu[$i]; ?></div>
<br class="clearBoth" />
but alas, it doesn't work, it outputs every type of option in the same $class rather than just switching the radio options. The whole point is to hide the radio buttons but nothing else. I'm still thinking that figuring out how to have a <input type="hidden" field output as an option would probably be best.
Bookmarks