• Resolved krystianergotopia

    (@krystianergotopia)


    Stop script from loading on all pages.

    I tried it with this code as well as with your custom hook to dequeue your script and the oneclick-upsell script from woocurve (they use also stripe). Its working for woocurve but your scripts are still loading on every page.

    function is_handsome_checkout(){
    if( get_post_type() == ‘handsome-checkout’ ){
    return true;
    }
    return false;
    }

    //add_action( ‘wp_enqueue_scripts’, ‘wc_dequeue_scripts’, 10 );
    add_action( ‘wp_footer’, ‘wc_dequeue_scripts’, 10 );

    function wc_dequeue_scripts() {
    if ( ! is_checkout() && ! is_account_page() && ! is_handsome_checkout() ) {
    wp_dequeue_script( ‘stripe’ );
    wp_dequeue_script( ‘ocustripe’ );
    }
    }

    This code from your side doesnt work on my end: https://github.com/moonstonemedia/WP-Simple-Pay-Snippet-Library/blob/master/conditionally-dequeue-scripts-styles.php

    The page I need help with: [log in to see the link]

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

The topic ‘script hooks not working’ is closed to new replies.