首页 > 代码库 > zencart产品属性dropmenu select只有一个选择项时自动变成radio单选的解决办法

zencart产品属性dropmenu select只有一个选择项时自动变成radio单选的解决办法

includes\modules\classic\attributes.php

在大约786行代码

case ($products_options->RecordCount() == 1):

 

的下面找到

$options_menu[] = zen_draw_radio_field(‘id[‘ . $products_options_names->fields[‘products_options_id‘] . ‘]‘, $products_options_value_id, ‘selected‘, ‘id="‘ . ‘attrib-‘ . $products_options_names->fields[‘products_options_id‘] . ‘-‘ . $products_options_value_id . ‘"‘) . ‘<label class="attribsRadioButton" for="‘ . ‘attrib-‘ . $products_options_names->fields[‘products_options_id‘] . ‘-‘ . $products_options_value_id . ‘">‘ . $products_options_details . ‘</label>‘ . "\n";

 

替换为

$options_menu[] = zen_draw_pull_down_menu(‘id[‘ . $products_options_names->fields[‘products_options_id‘] . ‘]‘, $products_options_array, $selected_attribute, ‘id="‘ . ‘attrib-‘ . $products_options_names->fields[‘products_options_id‘] . ‘"‘) . "\n";

 

即可。

zencart产品属性dropmenu select只有一个选择项时自动变成radio单选的解决办法