Modifying checkout.php

Homepage Forums WP Travel Modifying checkout.php

This topic contains 7 replies, has 2 voices, and was last updated by  Support Team 2 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #16779

    a-surbakt2000
    Participant

    Hi, I just wanted to add “I agree to terms and conditions” checkbox just before the “Book Now” button in the checkout page. I figure that I may be able to edit the checkout.php page and add the checkbox before the button element, I was just wondering whether this would be a safe thing to do (e.g. in case there are updates to the plug-in)?

    #16814

    Support Team
    Keymaster

    Hello,

    Yes, you can shift the position of the privacy policy message.

    for this, you need to add below-given code in your child theme functions.php file.

    To know how you can create and activate the child theme, refer to below-given link:

    https://wptravel.io/how-to-create-a-child-theme/

    After activating the child theme in your child theme functions.php file add below given code.

    function wp_travel_customize_booking_form($field){
    	$field['payment_fields']['wp_travel_checkout_gdpr']['priority'] = 500;
    	$field['payment_fields'] = wp_travel_sort_form_fields( $field['payment_fields'] );
    	return $field;
    }
    add_filter('wp_travel_checkout_fields','wp_travel_customize_booking_form', 21 );

    Hope this helps.

    Thank you.

    #16828

    a-surbakt2000
    Participant

    Hi Support Team! Thanks for the response!

    I was just wondering if it’s also possible to replace the phrase “Privacy Policy” to “Terms and Conditions”?

    #16841

    Support Team
    Keymaster

    Hello,

    Actually, the text “Privacy Policy” comes from the title of the page i.e. whichever page you assign from Admin panel > Setting > Privacy, the title from that page will appear in the checkout page.

    Screenshot:

    https://prnt.sc/o1njkx

    Hope this clears the confusion.

    If you have any issues further, kindly let us know.

    Thank you.

    #16842

    a-surbakt2000
    Participant

    Hi Support Team, yes the title appears in the checkout page but the label on the left side still says “Privacy Policy”. I would like that to be changed as well. Also, I notice that when I attempt to tick the bock the checkmark doesn’t appear?

    https://imgur.com/Pdem2XF

    Btw the website is https://coolportugal.com

    #16849

    Support Team
    Keymaster

    Hello,

    Add below given code in your child theme functions.php file.

     function wp_travel_customize_label($field){
    	unset($field['wp_travel_enquiry_gdpr']);
    	$field['payment_fields']['wp_travel_checkout_gdpr']['label'] = 'Terms & Conditions';
    return $field;
    
    }
    add_filter('wp_travel_checkout_fields','wp_travel_customize_label' );

    Hope this helps.

    Thank you.

    #16865

    a-surbakt2000
    Participant

    Hi Support Team,

    I tried to do that but the “Terms & Conditions” text appears below the Book Now button instead.

    For instance, in this screenshot : https://imgur.com/LyHwMUI, it appears in the red box, i’d like to just replace the green box with “Terms & Conditions” instead of “Privacy Policy”. Is that possible?

    #16911

    Support Team
    Keymaster

    Hello,

    The code that we have provided didn’t work because you do not have the latest WP Travel plugin. You are currently using the version 1.6.0 so if you want the code to work please update to the latest version of WP Travel plugin.

    Also, we did inspect the code from the version 1.0.6, but it is not possible to modify the code to make them work as you want.

    Hope this clears the confusion.

    If you have any issues further then kindly let us know.

    Thank you.

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

You must be logged in to reply to this topic.