WordPress.org

Forums

WooCommerce - excelling eCommerce
[resolved] Overriding billing fields not working (2 posts)

  1. salaac
    Member
    Posted 9 months ago #

    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/

  2. salaac
    Member
    Posted 9 months ago #

    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

Reply

You must log in to post.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic