I'm using WooCommerce: Add Checkout Fees Based on Custom Radio Button from businessbloomer
My question is about woocommerce_form_field()
which is used in part 1
// etc...
echo '<div id="checkout-radio">';
echo '<h3>Customize Your Order!</h3>';
woocommerce_form_field( 'radio_choice', $args, $chosen );
echo '</div>';
// etc...
The structure of the HTML that woocommerce_form_field( 'radio_choice', $args, $chosen );
outputs is
<p class="form-row form-row-wide update_totals_on_change" id="radio_choice_field" data-priority="">
<span class="woocommerce-input-wrapper">
<input type="radio" class="input-radio " value="0" name="radio_choice" id="radio_choice_0">
<label for="radio_choice_0" class="radio ">No Option</label>
<input type="radio" class="input-radio " value="10" name="radio_choice" id="radio_choice_10">
<label for="radio_choice_10" class="radio ">Option 1 ($10)</label>
<input type="radio" class="input-radio " value="30" name="radio_choice" id="radio_choice_30" checked="checked">
<label for="radio_choice_30" class="radio ">Option 2 ($30)</label>
</span>
</p>
The structure that I'm trying to get is this:
<div>
<ul>
<!-- here every element which is gonna be type radio needs to be with It's label in a <li> element -->
<li>
<input type='radio'> </input>
<label>No option</label>
</li>
<li>
<input type='radio'> </input>
<label>Option 2</label>
</li>
<li>
<input type='radio'> </input>
<label>Option 2</label>
</li>
</ul>
</div>
I searched for a solution but I could find one for the radio button