• Resolved ikramy

    (@ikramy)


    Hi,

    I’m trying to order the checkout fields. Everything works fine except the order of the password field.

    The result I get is:
    1- The order of the password field is not changing.
    2- I get a new field under the email field!

    Code below. Any idea?
    Thanks

    add_filter("woocommerce_checkout_fields", "order_fields");
    
    function order_fields($fields) {
    
        $order = array(
            "billing_first_name",
            "billing_last_name",
            "billing_phone",
            "billing_email",
            "account_password",
            "billing_area",
            "billing_address_type",
            "billing_building",
            "billing_room",
            "billing_notes"
    
        );
        foreach($order as $field)
        {
            $ordered_fields[$field] = $fields["billing"][$field];
        }
    
        $fields["billing"] = $ordered_fields;
        return $fields;
    
    }

    https://www.ads-software.com/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Reordering fields’ is closed to new replies.