Support » Plugins and Hacks » WooCommerce » Overriding billing fields not working

  • Resolved salaac

    (@salaac)


    So I am using wordpress with woocommerce. Goal is to translate all billing information fields in checkout. I have done some fields and they work great, but im stuck on two fields, they dont work as expected. When I hit refresh for a second field label changes for those two broken fields but when page loads fully its back to default. Why?

    $fields['billing']['billing_country']['label'] = 'valsts'; //works
     $fields['billing']['billing_first_name']['label'] = 'vards'; // works
     $fields['billing']['billing_last_name']['label'] = 'uzvards'; // works
     $fields['billing']['billing_company']['label'] = 'kompanija'; // works
     $fields['billing']['billing_address_1']['label'] = 'adrese'; // not working
     $fields['billing']['billing_city']['label'] = 'pilseta'; // not working

    https://wordpress.org/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Somehow I have missed this part here in documentation, this solves all:

    In some specific cases you will need to use the woocommerce_default_address_fields filter. This filter is applied to all billing and shipping default fields:

    country
    first_name
    last_name
    company
    address_1
    address_2
    city
    state
    postcode

Viewing 1 replies (of 1 total)
  • The topic ‘Overriding billing fields not working’ is closed to new replies.