- This topic has 9 replies, 2 voices, and was last updated 4 years, 3 months ago by
Support Team.
- AuthorPosts
- February 4, 2019 at 7:38 am #10360
privatejeep
ParticipantYour Billing Address is the wrong format and missing fields for the United States!
I need an update ASAP to the Billing Address fields on checkout to match the United States.
REQUIRED FIELDS SHOULD BE:
Street Address *
City *
State * MISSING!!! Need this field added and required asap!!!
Postal *
Country * this field should come last and we need this set to the United States by default already!When a payment is pending the person who books name doesn’t show in the admin side bookings.
ALSO!!! 100% each additional traveler their info fields MUST be required!!! NOT OPTIONAL.
I hope you can make these changes in your next update. My bookings are a mess!
My site: https://www.privatejeep.com/
THANKS!
February 4, 2019 at 12:40 pm #10373Support Team
KeymasterHello @privatejeep,
You can add the field through the child theme using the filter “wp_travel_checkout_billing_fields”.
For eg to add the states in the billing field add below given code:
function wp_travel_customize_billing_field( $fields ){ $fields['state'] = array ( 'type' => 'text', 'label' => __( 'State', 'wp-travel' ), 'name' => 'wp_travel_state', 'id' => 'wp-travel-address', 'validations' => array( 'required' => true, 'maxlength' => '50', ), 'default' => 'State name', 'priority' => 15, ); return $fields; } add_filter('wp_travel_checkout_billing_fields','wp_travel_customize_billing_field');
Similarly, for other fields add an array and define the type, label etc.
Yes, currently only lead traveler form is required. Also, we are planning in adding the option to manage the setting for the backend.
Thank you very much for your co-operations.
Regards!!
February 4, 2019 at 3:49 pm #10378privatejeep
ParticipantOkay I have added the State code but the fields are out of order.
How can the fields be arranged properly?
The correct order MUST be:
Address
City
State
Postal
CountryFebruary 5, 2019 at 3:58 am #10394Support Team
KeymasterHello @privatejeep,
You need to set the priority number. You can manage the priority number from “‘priority’ => 15,” this line of code. You can place the field in your desired location by setting the priority number.
Hope this helps.
Best Regards!!
February 5, 2019 at 4:47 am #10396privatejeep
ParticipantOkay I was able to move the State field to the correct location by setting ‘priority’ => 20,
How can I move the Country field to the last place below Postal? Those two are still out of order for the United States.
February 5, 2019 at 5:56 am #10401Support Team
KeymasterHello @privatejeep,
To move the country field you need to change the priority label of the country through the child theme.
Eg:
function wp_travel_customize_billing_field( $fields ){ $fields['state'] = array ( 'type' => 'text', 'label' => __( 'State', 'wp-travel' ), 'name' => 'wp_travel_state', 'id' => 'wp-travel-address', 'validations' => array( 'required' => true, 'maxlength' => '50', ), 'default' => 'State name', 'priority' => 15, ); $fields['country']['priority'] = 91; return $fields; } add_filter('wp_travel_checkout_billing_fields','wp_travel_customize_billing_field');
Replace above provided with this code.
Here just line “$fields[‘country’][‘priority’] = 91;” will do work for you. For other as well follow similar process.
Thank you.
Regards!!
February 5, 2019 at 6:07 am #10402privatejeep
ParticipantWhen I put in that code I get this error on my site:
Fatal error: Cannot redeclare wp_travel_customize_billing_field() (previously declared in /homepages/xx/xxxxxxxx/htdocs/privatejeep/wp-content/themes/travel-log-child/functions.php:111) in /homepages/xx/xxxxxxxx/htdocs/privatejeep/wp-content/themes/travel-log-child/functions.php on line 147
I already have some country code in there to make the United States the default field value.
February 5, 2019 at 10:40 am #10412Support Team
KeymasterHello @privatejeep,
You have the same function defined in two files or you have the same function defined in two places in the same file.
So, Remove this code.
function wp_travel_customize_billing_field( $fields ){ $fields['state'] = array ( 'type' => 'text', 'label' => __( 'State', 'wp-travel' ), 'name' => 'wp_travel_state', 'id' => 'wp-travel-address', 'validations' => array( 'required' => true, 'maxlength' => '50', ), 'default' => 'State name', 'priority' => 15, ); return $fields; } add_filter('wp_travel_checkout_billing_fields','wp_travel_customize_billing_field');
and add below given code.
function wp_travel_customize_billing_field( $fields ){ $fields['state'] = array ( 'type' => 'text', 'label' => __( 'State', 'wp-travel' ), 'name' => 'wp_travel_state', 'id' => 'wp-travel-address', 'validations' => array( 'required' => true, 'maxlength' => '50', ), 'default' => 'State name', 'priority' => 15, ); $fields['country']['priority'] = 91; return $fields; } add_filter('wp_travel_checkout_billing_fields','wp_travel_customize_billing_field');
Hope this works.
Regards!!
February 5, 2019 at 9:30 pm #10451privatejeep
ParticipantOkay that works now but with the state field priority set to: 20 and country priority set to: 50.
Now the address fields are in the proper order for the entire country of the United States.
This needs to be an option for people to have it this way without needed to code the child theme. 😉Now all we have to tackle is having the ability to set the default country code in every place/field that country is asked for. These things are important to make the checkout process quick and easy for people.
February 6, 2019 at 4:21 am #10455Support Team
KeymasterHello @privatejeep
Thank you so much for your suggestion. We will for sure mark this suggestion and work on it in our upcoming updates.
Also, feel free to report us if you find any other enhancements that we can make in WP Travel to make it more easy and user friendly 🙂
Regards!!
- AuthorPosts
- The forum ‘WP Travel’ is closed to new topics and replies.