Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Выбор первой опции ratio по умолчанию


Recommended Posts


Столкнулся с проблемой выбора опции по умолчанию

Вот код, что нужно сделать чтоб выбиралась первая опция?

        <?php if ($option['type'] == 'radio') { ?>
        <div id="input-option<?php echo $option['product_option_id']; ?>" class="option form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
          <b><?php if ($option['required']) { ?>* <?php } ?><?php echo $option['name']; ?>:</b>
          <?php foreach ($option['product_option_value'] as $option_value) { ?>
		  <div class="option_radio">
          <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']; ?>"></label>
		  <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 } ?>
          <?php } ?>
        <?php } ?>


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.