Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Checkout reorder woocommerce fields

Home / Forums / Virtue Theme / Checkout reorder woocommerce fields

This topic is: Not Resolved
[Not Resolved]
Posted in: Virtue Theme
May 8, 2017 at 3:41 am

hello,
i try to change billing fields for woocommerce checkout but i have problem

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

  • The forum ‘Virtue Theme’ is closed to new topics and replies.