Y
Y
Yuri Avanesov2018-03-29 15:51:35
WordPress
Yuri Avanesov, 2018-03-29 15:51:35

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'] ) );
}
?>

This is in the form-edit-address.php file in the woocomerce\templates\myaccount folder.
On the site, all these fields are displayed through the p tag with the class:
form-row form-row-first validate-required" id="billing_first_name_field" data-priority="10">

Actually, I need to change the output, add additional classes.
Where is that upper code formed? How to change it?
thank!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
E, 2018-03-29
@aylo

look at my answer , it's the same here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question