• Resolved barbuduweb

    (@barbuduweb)


    Hello!

    Is there a way to prevent plugin scripts and styles from loading on a non-product page?

    The filters “disable_wvg_inline_style” and “disable_wvg_enqueue_scripts” are not longer usable.

    Thank you a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support fizanzvai

    (@fizanzvai)

    @barbuduweb

    Add the below snippet using Code Snippets plugin or, inside your current theme’s functions.php file.
    Note: Please use a child theme otherwise the modification will be lost once you update your theme.

    add_filter( 'disable_woo_variation_gallery', function( $default ){
    	if( !is_woocommerce() ){
    		return true;
    	}
    	return $default;
    } );
    
    add_filter( 'woo_variation_gallery_slider_template_js', function( $data ){
    	if( !is_woocommerce() ){
    		return;
    	}
    	return $data;
    } );
    Thread Starter barbuduweb

    (@barbuduweb)

    Thanks a lot, it works perfectly!

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

The topic ‘Loading scripts and plugin styles’ is closed to new replies.