Billing Address WRONG FORMAT!!!

Homepage Forums WP Travel Billing Address WRONG FORMAT!!!

This topic contains 9 replies, has 2 voices, and was last updated by  Support Team 5 months, 1 week ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #10360

    privatejeep
    Participant

    Your 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!

    #10373

    Support Team
    Keymaster

    Hello @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!!

    #10378

    privatejeep
    Participant

    Okay 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
    Country

    #10394

    Support Team
    Keymaster

    Hello @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!!

    #10396

    privatejeep
    Participant

    Okay 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.

    #10401

    Support Team
    Keymaster

    Hello @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!!

    #10402

    privatejeep
    Participant

    When 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.

    • This reply was modified 5 months, 1 week ago by  privatejeep.
    #10412

    Support Team
    Keymaster

    Hello @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!!

    #10451

    privatejeep
    Participant

    Okay 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.

    #10455

    Support Team
    Keymaster

    Hello @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!!

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.