Woocommerce Checkout Page Customization

And Back to the Future.

Reorder checkout fields:

add_filter( 'woocommerce_checkout_fields', 'condless_reordering_checkout_fields' );
function condless_reordering_checkout_fields( $fields ) {
        $billing_order = array(
        $count = 0;
        $priority = 10;
        foreach( $billing_order as $field_name ) {
                $fields['billing'][$field_name]['priority'] = $count * $priority;
        $fields['billing']['billing_email']['class'] = array('form-row-first');
        $fields['billing']['billing_phone']['class'] = array('form-row-last');
        $fields['billing']['billing_postcode']['class'] = array('form-row-first');
        $fields['billing']['billing_city']['class'] = array('form-row-last');
        return $fields;

As you probably have noticed- Jigowatt ltd, the developers of Jigoshop on which WooCommerce code is based, was named after the pronunciation mistake of the word Gigawatt in the movie Back to the Future.

Leave a Reply

Your email address will not be published. Required fields are marked *