Home Forums WoodMart support forum reordering checkout fields

reordering checkout fields

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #686815

    shweta
    Participant

    Hello Team,

    We are trying to reorder checkout fields in WooCommerce so that Pin Code appears before City.

    Currently:

    * billing\_city → priority 70
    * billing\_postcode → priority 80

    We tried using the following snippet with woocommerce_checkout_fields, but it did not take effect:

    php
    add_filter( 'woocommerce_checkout_fields', 'reorder_checkout_fields', 99 );
    function reorder_checkout_fields( $fields ) {
        $fields['billing']['billing_postcode']['priority'] = 65;
        $fields['billing']['billing_city']['priority']     = 70;
        return $fields;
    }

    We also tested with caching disabled and cart fragments excluded.

    To force the order, we are now using woocommerce_default_address_fields:

    php
    add_filter( 'woocommerce_default_address_fields', 'force_address_field_order', 999 );
    function force_address_field_order( $fields ) {
        $fields['postcode']['priority'] = 65;
        $fields['city']['priority']     = 70;
        return $fields;
    }

    Can you please confirm if this is the correct and recommended way to ensure Pin Code always appears before City across checkout and account address forms?

    Thank you.

    #686827

    shweta
    Participant

    Patcher 685012 was applied. It was to do with cart and checkout. Do you think that any other file is governing the cart and checkout now? and could it be the reason the code snippet is not working?

    #686946

    Hello,

    Please use the WoodMart Checkout Field Manager feature to rearrange the checkout fields.
    Here is our documentation on how to use it https://xtemos.com/docs-topic/fields-manager/

    Best Regards,

    #687660

    shweta
    Participant

    This was so perfect. Just want to check, how can we change checkout labels?

    For example, changing ‘First name’ to what ‘would you liked to be called and so on’?

    #687680

    Hello,

    If you want to change the label titles, you need to use the Loco Translate plugin, more details on how to use it are here – https://xtemos.com/docs-topic/translate-woodmart-theme-with-loco-translate/

    Best Regards,

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)