Need help dequeuing variation script only on product pages

Top WooCommerce & WordPress Plugins Forums Color or Image Variation Swatches for WooCommerce Need help dequeuing variation script only on product pages

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #98334
    ap
    Guest

    Hi,
    I would like to dequeue the variation script and only load it on product pages. I tried to use the handle alg-wc-civs but without succes.

    add_action( 'wp_enqueue_scripts', 'dequeue_alg_wc_civs', 0);
    function dequeue_alg_wc_civs() {
        // if this is not the product page, remove the script
        if( ! is_product() ){
            wp_dequeue_script( 'alg-wc-civs' );
        }
    }
    

    Any idea what I’m doing wrong?

    #98335
    Pablo Pacheco
    Participant

    Hello,
    I’ve just created a new option for you to load Scripts Only on Product Page.
    Please try version 1.1.2 and let me know 😉

    #98336
    Ap Strikwerda
    Participant

    Great! Works perfect – Thanks! Really appreciate it!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.