title: I want to make the first value of a radio list be checked by default in Open Cart
body: <p>I added <code>checked=checked</code>, but the last option was selected. I want the first option. How can I do that?</p>
  
  <pre><code>&lt;?php
  
  
           if ($options) { ?&gt;
            &lt;?php $i=1; foreach ($options as $option) { ?&gt;
  
              &lt;?php if ($option['type'] == 'select') { ?&gt;
                  &lt;?php if($i==2) {    $s=0;?&gt;
                  &lt;div id="option-&lt;?php echo $option['product_option_id']; ?&gt;" class="mug_option" style="float:left; width:45%;"&gt;
                    &lt;?php echo $text_imprint_side1;?&gt;
  
                    &lt;?php foreach ($option['option_value'] as $option_value) { ?&gt;
  
                    &lt;div&gt;&lt;input type="radio" checked="checked" name="mug_option[&lt;?php echo $option['product_option_id']; ?&gt;]" value="&lt;?php echo $option_value['product_option_value_id']; ?&gt;" id="mug-option-value-&lt;?php echo $option_value['product_option_value_id']; ?&gt;" class="color_opt" /&gt;
    &lt;label for="mug-option-value-&lt;?php echo $option_value['product_option_value_id']; ?&gt;"&gt;&lt;?php echo $option_value['name']; ?&gt;
     &lt;?php if ($option_value['price']) { ?&gt;
      &lt;input type="hidden" name="opt_price" id="opt_price&lt;?php echo $option_value['product_option_value_id']; ?&gt;" value="&lt;?php echo $option_value['price_without_symbol']; ?&gt;" /&gt;
     &lt;?php } else { ?&gt;
      &lt;input type="hidden" name="opt_price" id="opt_price&lt;?php echo $option_value['product_option_value_id']; ?&gt;" value="0" /&gt;
     &lt;?php } ?&gt;
  
    &lt;/label&gt;
    &lt;/div&gt;
                   &lt;?php } ?&gt;
                  &lt;/div&gt;
                  &lt;?php } ?&gt;
  </code></pre>