If like us you don’t think it’s a great idea to leave it to the customer to calculate the correct options value in Opencart we did a quick hack and copied here in case you’re looking for a similar solution.
After some small changes to the file the options for the radio options show the actual price rather than +4.95, +10.95 etc.
The changes are needed in the options.tpl file located > theme > yourtheme > product > includes > options.tpl
Around line 22 find this code
<?php if ($option[‘type’] == ‘radio’) : //Radio Buttons ?>
<div id=”option-<?php echo $option[‘product_option_id’]; ?>”>
<strong><?php echo $option[‘name’]; ?> <?php if ($option[‘required’]) { ?><span>*</span><?php } ?></strong>
<?php foreach ($option[‘option_value’] as $option_value) : ?>
<input type=”radio” name=”option[<?php echo $option[‘product_option_id’]; ?>]” value=”<?php echo $option_value[‘product_option_value_id’]; ?>” id=”option-value-<?php echo $option_value[‘product_option_value_id’]; ?>” />
<label for=”option-value-<?php echo $option_value[‘product_option_value_id’]; ?>”><?php echo $option_value[‘name’]; ?>
<?php if ($option_value[‘price’]) : ?>
(<?php echo $option_value[‘price_prefix’]; ?><?php echo $option_value[‘price’]; ?>)
<?php endif; ?>
</label>
<?php endforeach; ?>
</div>
<?php endif; ?>
And replace it with this… (it could be tidier!)
<?php if ($option[‘type’] == ‘radio’) : //Radio Buttons
?>
<?php $firstprice = 1; ?>
<div id=”option-<?php echo $option[‘product_option_id’]; ?>”>
<strong><?php echo $option[‘name’]; ?> <?php if ($option[‘required’]) { ?><span>*</span><?php } ?></strong>
<?php foreach ($option[‘option_value’] as $option_value) : ?>
<input type=”radio” name=”option[<?php echo $option[‘product_option_id’]; ?>]” value=”<?php echo $option_value[‘product_option_value_id’]; ?>” id=”option-value-<?php echo $option_value[‘product_option_value_id’]; ?>” />
<label for=”option-value-<?php echo $option_value[‘product_option_value_id’]; ?>”><?php echo $option_value[‘name’]; ?>
<?php if ($firstprice==1) echo $price;
$firstprice =2;
?>
<?php if ($option_value[‘price’]) : ?>
<?php
$priceA = $option_value[‘price’];
$aaa = explode(“£”,$priceA);
$bbb = floatval($aaa[1]);
$ccc = explode(“£”,$price);
$ddd = floatval($ccc[1]);
$showprice = $bbb + $ddd;
?>
£<?php echo $showprice; ?>
<?php endif; ?>
</label>
<?php endforeach; ?>
</div>
<?php endif; ?>