admin管理员组

文章数量:1334697

Normally, woocommerce html output for checkout fields (billing and shipping sections) places label tags before input tags and wraps it all in a paragraph tag. I'm trying to alter the Woocommerce function that outputs the checkout fields to display the the input tags before the label tags without using any javascript.

The HTML currently looks like this:

<p class="form-row form-row-last thwcfd-field-wrapper thwcfd-field-text validate-required" id="billing_last_name_field" data-priority="30">
    <label for="billing_last_name" class="">Last name&nbsp;<abbr class="required" title="required">*</abbr></label>
    <span class="woocommerce-input-wrapper">
        <input type="text" class="input-text " name="billing_last_name" id="billing_last_name" placeholder="" value="saye" autocomplete="family-name">
    </span>
</p>

But i'm trying to get it to look like this:

<p class="form-row form-row-last thwcfd-field-wrapper thwcfd-field-text validate-required" id="billing_last_name_field" data-priority="30">
    <span class="woocommerce-input-wrapper">
        <input type="text" class="input-text " name="billing_last_name" id="billing_last_name" placeholder="" value="saye" autocomplete="family-name">
    </span>
    <label for="billing_last_name" class="">Last name&nbsp;<abbr class="required" title="required">*</abbr></label>
</p>

Thanks guys.

本文标签: phpModify HTML structure of fields in woocommerce checkout form