Answer the question
In order to leave comments, you need to log in
How to activate the radio switch after clicking on the option picture?
There is a radio switcher with pictures of the option
How to make the radio itself become selected after clicking on the IMG picture?
Here is the radio buttons code
<?php if ($option['type'] == 'radio') { ?>
<div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
<label class="control-label"><?php echo $option['name']; ?></label>
<div id="input-option<?php echo $option['product_option_id']; ?>">
<?php foreach ($option['product_option_value'] as $option_value) { ?>
<div id="pp_options_radio" class="radio">
<label>
<input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" class="pp_options"/>
<?php if ($option_value['image']) { ?>
<img src="<?php echo $option_value['image']; ?>" data-toggle="tooltip" data-placement="top" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" title="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" class="img-thumbnail pp_img_options" />
<?php } ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
Answer the question
In order to leave comments, you need to log in
<input id="item">
<img onclick="set('item')">
<script>
function set(id)
{
$('#'+id).click();
}
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question