WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Problem on adding class to input fields (1 post)

  1. uili
    Member
    Posted 1 year ago #

    Hey there, im following this tutorial to add class to input fields
    http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

    Here is my code:

    add_filter( 'woocommerce_billing_fields', 'wc_npr_filter_phone', 10, 1 );
    
    function wc_npr_filter_phone( $address_fields ) {
       $address_fields['billing_phone']['class'] = array('input-text input-block-level');
       return $address_fields;
    }

    its actually adding the class i want, but wrong place, it`s adding to the <strong><p></strong> wich wraps the input field, and not into the <input> itself!

    <p class="form-row input-text input-block-level validate-required" id="billing_phone_field">
       <label for="billing_phone" class="">Telefone <abbr class="required" title="obrigatório">*</abbr></label>
       <input type="text" class="input-text" name="billing_phone" id="billing_phone" placeholder="Telefone" value="4891675952">
    </p>

    what could it be?

    http://wordpress.org/extend/plugins/woocommerce/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.