Hi All,
I think it would be a good idea to change the product option dropdown menu under 'Available options:' to radio buttons. Is it complicated? Only the catalog/template/default/content/product.tpl file has to be modified or other file as well?
thanks
frame
I have changed my code from:
to:
The radio buttons are visible but clicking on the Add to Cart button something's wrong. Only the product's name is given to the cart, the product option and the stock (quantity) unfortunately not. What am I doing wrong?
Code: Select all
<table class="b">
<?php foreach ($options as $option) { ?>
<tr>
<td><?php echo $option['name']; ?>:</td>
<td><select name="option[<?php echo $option['option_id']; ?>]">
<?php foreach ($option['value'] as $option_value) { ?>
<option value="<?php echo $option_value['product_to_option_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
<?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?><?php echo " (".$option_value['sub_quantity'].$text_on_stock.")"; ?>
<?php } else { ?><?php echo $option_value['price']; ?><?php echo " (".$option_value['sub_quantity'].$text_on_stock.")"; ?>
<?php } ?>
</option>
<?php } ?>
</select></td>
</tr>
<?php } ?>
</table>
Code: Select all
<table class="b">
<?php foreach ($options as $option) { ?>
<tr>
<td><?php echo $option['name']; ?>:</td>
<tr><td>
<?php foreach ($option['value'] as $option_value) { ?>
<input type="radio" name="option[<?php echo $option['option_id']; ?>]">
<value="<?php echo $option_value['product_to_option_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
<?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?><?php echo " (".$option_value['sub_quantity'].$text_on_stock.")"; ?>
<?php } else { ?><?php echo $option_value['price']; ?><?php echo " (".$option_value['sub_quantity'].$text_on_stock.")"; ?>
<?php } ?>
<br>
<?php } ?>
</tr></td>
</tr>
<?php } ?>
</table>
frame wrote:
:
]">
">
The radio buttons are visible but clicking on the Add to Cart button something's wrong. Only the product's name is given to the cart, the product option and the stock (quantity) unfortunately not. What am I doing wrong?
You have "value" as a separate tag. value is part of the input tag. Remove the > from the end of the input name and remove the at the end of value
That will fix it
Last edited by Qphoria on Mon Dec 08, 2008 11:36 pm, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 3 guests