最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Modify HTML structure of fields in woocommerce checkout form

programmeradmin1浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论