I'm trying to change a code that selects options for a product to radio selections instead.
Original Code:
My Code:
It semi-works, but for some reason, it only grabs the value of one of the 'options.'
For example, the product is an Apple iPod.
There's an option to add the 1GB version or the 8GB version, it only adds the 8GB version.
I checked all the variables, and they're working properly.
Help?
Original Code:
Code:
<select name="option[<?php echo $option['option_id']; ?>]">
<?php foreach ($option['option_value'] as $option_value) { ?>
<option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
<?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>
<?php } ?>
</option>
<?php } ?>
</select>
My Code:
Code:
<tr>
<?php echo $option['name']; ?>:<br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<td>
<label for="option-value-<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?></label>
<br />
<input type="radio" name="option[<?php echo $option['option_id']; ?>]" value="<?php echo $option_value['option_value_id']; ?>" id="option-value-<?php echo $option_value['option_value_id']; ?>" />
</td>
<?php } ?>
</tr>
It semi-works, but for some reason, it only grabs the value of one of the 'options.'
For example, the product is an Apple iPod.
There's an option to add the 1GB version or the 8GB version, it only adds the 8GB version.
I checked all the variables, and they're working properly.
Help?