Answer the question
In order to leave comments, you need to log in
How to change structure of fields in woocomerce addresses?
Hello!
I am currently redesigning a store using the woocomerce plugin. Faced the following problem:
In the personal profile of each client there is a tab Addresses (billing address). In it, I want to change the structure of the fields and add my own classes to them. All these fields are output via the function:
<?php
foreach ( $address as $key => $field ) {
if ( isset( $field['country_field'], $address[ $field['country_field'] ] ) ) {
$field['country'] = wc_get_post_data_by_key( $field['country_field'], $address[ $field['country_field'] ]['value'] );
}
woocommerce_form_field( $key, $field, wc_get_post_data_by_key( $key, $field['value'] ) );
}
?>
form-row form-row-first validate-required" id="billing_first_name_field" data-priority="10">
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question