• Resolved kklo

    (@kklo)


    Hi,

    I would like the current “terms and conditions” link in woocomerce to open an external page with the “terms and conditions”.

    You do not upload the terms and conditions and javascript is disabled in the browser. The same happens in other browsers, like firefox and IE.

    Is it possible to create a link to the external page? How to do this?

    How to solve this?

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • ValeDeOro

    (@valedeoro)

    Automattic Happiness Engineer

    WooCommerce 3.2 opens the “Terms and Conditions” link in a new window. Does this solve your question?

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy!

    It is possible, with the following code:

    function disable_terms_toggle() {
            wp_enqueue_script( 'disable-terms-toggle', '/disable-terms-toggle.js', array( 'wc-checkout', 'jquery' ), null, true );
            wp_add_inline_script( 'disable-terms-toggle', "jQuery( document ).ready( function() { jQuery( document.body ).off( 'click', 'a.woocommerce-terms-and-conditions-link' ); } );" );
    }
    
    add_action( 'wp_enqueue_scripts', 'disable_terms_toggle', 1000 );
    
    function custom_terms_and_conditions_link( $link ) {
        return 'https://google.com';
    }
    add_filter( 'woocommerce_get_terms_page_permalink', 'custom_terms_and_conditions_link' );

    The first function disables the toggle, and the second one sets a custom redirect link.

    This custom code should be added to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as Code Snippets. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Terms and conditions’ is closed to new replies.