hello,
i try to change billing fields for woocommerce checkout but i have problem
*Login to see link
I have try:
1) themes/virtue_premium-child/functions.php
add_filter( ‘woocommerce_order_formatted_billing_address’ , ‘reorder_billing_address’ );
function reorder_billing_address() {
$address = array(
‘first_name’ => $this->billing_first_name,
‘last_name’ => $this->billing_last_name,
‘address_1’ => $this->billing_address_1,
‘address_2’ => $this->billing_address_2,
‘city’ => $this->billing_city,
‘postcode’ => $this->billing_postcode,
‘state’ => $this->billing_state,
‘country’ => $this->billing_country,
‘company’ => $this->billing_company
);
return $address;
}
2) themes/virtue_premium-child/woocommerce/checkout/form-billing.php
<?php
// order the keys for your custom ordering or delete the ones you don’t need
$mybillingfields=array(
“billing_first_name”,
“billing_last_name”,
“billing_address_1″,
//”billing_address_2”,
“billing_city”,
“billing_state”,
“billing_postcode”,
“billing_country”,
“billing_phone”,
“billing_email”,
“wc_billing_field_5948”,
“billing_company”,
“wc_billing_field_3019”,
“wc_billing_field_9181”
);
foreach ($mybillingfields as $key) : ?>
<?php woocommerce_form_field( $key, $checkout->checkout_fields[‘billing’][$key], $checkout->get_value( $key ) ); ?>
<?php endforeach; ?>
When load page sort it` s ok, ex (company name is down) but when complete load,
company name go up (down from first and last name)
How can i solve that?
thank you