How to check if woocommerce is activated in theme
You could check to see if the ‘WooCommerce’ class exists, then run the code that requires WooCommerce. <?php if ( class_exists( ‘WooCommerce’ ) ) { // code that requires WooCommerce } else { // you don’t appear to have WooCommerce activated } ?>