Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking New tab for terms and conditions
- This topic has 2 replies, 2 voices, and was last updated 3 years, 7 months ago by Andre Flores.
Viewing 3 posts - 1 through 3 (of 3 total)
- AuthorPosts
- May 7, 2021 at 4:02 pm #1117939Rachel BrownParticipant
My client would like the terms and conditions to open in a new tab rather than opening in the checkout page. How can I achieve this? Thanks!
May 11, 2021 at 10:13 pm #1119720Rachel BrownParticipantIt’s been days since I asked this question, and my client would appreciate an update on this issue. Thanks!
May 11, 2021 at 11:54 pm #1119768Andre FloresModeratorHello Rachel,
You will need to override default Terms & Conditions section function. In order to do that add the following code to your child theme functions.php file:
add_action( 'wp_head', 'remove_renderTermsAndConditions' ); function remove_renderTermsAndConditions(){ remove_action( 'mphb_sc_checkout_form', array( '\MPHB\Views\Shortcodes\CheckoutView', 'renderTermsAndConditions' ), 60 ); } add_action( 'mphb_sc_checkout_form', 'custom_renderTermsAndConditions', 60 ); function custom_renderTermsAndConditions(){ $termsPageId = MPHB()->settings()->pages()->getTermsAndConditionsPageId(); $termsHtml = MPHB()->settings()->main()->getTermsAndConditionsText(); if ( !empty( $termsHtml ) ) { ?> <section class="mphb-checkout-terms-wrapper mphb-checkout-section"> <div class="mphb-terms-and-conditions"> <?php echo $termsHtml; ?> </div> <p class="mphb-terms-and-conditions-accept"> <label> <input type="checkbox" id="mphb_accept_terms" name="mphb_accept_terms" value="1" required="required" /> <?php $termsPageUrl = get_permalink( $termsPageId ); $termsPagelink = '<a class="mphb-terms-and-conditions-link-theme" href="' . esc_url( $termsPageUrl ) . '" target="_blank">' . _x( 'terms & conditions', 'I\'ve read and accept the terms & conditions', 'motopress-hotel-booking' ) . '</a>'; printf( _x( 'I\'ve read and accept the %s', 'I\'ve read and accept the <tag>terms & conditions</tag>', 'motopress-hotel-booking' ), $termsPagelink ); ?> <abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr> </label> </p> </section> <?php } }
Regards,
Andre - AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.