For official release installed or not,
/**
* Check if WooCommerce is active
**/
$plugin_path = trailingslashit( WP_PLUGIN_DIR ) . 'woocommerce/woocommerce.php';
if (
in_array( $plugin_path, wp_get_active_and_valid_plugins() )
|| in_array( $plugin_path, wp_get_active_network_plugins() )
) {
// Custom code here. WooCommerce is active, however it has not
// necessarily initialized (when that is important, consider
// using the `woocommerce_init` action).
}
You could check the article from the woocommerce that it could be more compatiable.
Related Posts:
- Share users and WooCommerce memberships between two installations
- What’s the difference between WC() and $woocommerce
- Show only geolocated user country into Woocommerce checkout country fields
- Add product attribute to Woocommerce’s blocks in Gutenberg
- The correct way to override WooCommerce product gallery from a plugin [closed]
- How to get woocomerce attributes thumbnail in PHP? [closed]
- How to have specific prices for some particular pin codes in woocommerce? [closed]
- How to automatically add and show all the product attributes when creating a new product
- How do I get the latest note on the order at woocommerce? [closed]
- Woocommerce Login Redirect not working [closed]
- global $post; in WooCommerce
- Woocommerce template single-product.php in theme folder not working
- How can i create a WooCommerce product programatically or using sql query?
- Is it safe to update WooCommerce data update?
- Output JSON object with woocommerce products
- Display description on cart page
- Which hook should I use to capture $_POST(‘password’) via profile update and password reset
- Fatal Error in WordPress WooCommerce theme “Call to undefined function wc_get_theme_slug_for_templates()”
- Problems adding in-store product managers
- differentiate hooks and filters on the same page [closed]
- Signup Form that adds customer to MailChimp, redirects to checkout, and fills in form data
- how to pass a woocommerce product name to contact form7 [closed]
- Woocommerce Subscription Pricing/Billing Schedule
- ‘profile_update’ hook alternative for WooCommerce user meta data
- How to add a user custom field into Woocommerce emails?
- WooCommerce subscription, give option to prorate or not to prorate to user while switching subscription
- WooCommerce Product URL re-writing
- Automatically running Scheduled Actions
- Hook to use when customer placing order
- Woocommerce Rest Api Categories problem [closed]
- wc-ajax=get_variation slow speed in WooCommerce
- Add custom CSS class to product images
- Get product variation attribute titles – WooCommerce
- Calculate tax on sales price excluding discount [closed]
- One file for all virtual, downloadable product variations [closed]
- Remove “?add-to-cart=product-id” from Add to Cart URL when on the Cart page
- How to show total amount on woocommerce?
- Changing a text label into an image
- Custom Price for WooCommerce [closed]
- Disable Order Review Page when the id product
- Set both meta_query and tax_query using wp_query->set
- Is there a preset CSS class when shopping cart isn’t empty?
- How to translate text in function.php with WPML [closed]
- Woocommerce product options [closed]
- WordPress SMS API integration without plugin error
- Absolute search against wordpress api
- Protecting WooCommerce Customizations with Update
- Setting WooCommerce SKU programmatically [closed]
- How to edit mobile view of my wordpress website without affecting the desktop view? [closed]
- Code specific for specific products
- Change Firstname & Lastname order in the order-processing e-mail templates
- WooCommerce: How to insert filtered attribute(s) in page title of archive?
- Multiple Pricing [closed]
- WOOF product filter prevent from loading on wordpress search result page
- Adding product on sale into specific category after creation
- Trying to run Javascript on AJAX call
- Rewrite rules for sub category (child product categry & grand-child)
- How to select the first product variant as a default?
- WooCommerce – dynamically loading checkout page using ajax not showing payment methods for guest
- Two Filter Issue [closed]
- Show notice to user based on User Meta
- Google Analytics gtag code messes up woocommerce cart & login
- Pass values to ajax
- Send Email to Custom Field in Custom Post Type when order is Completed
- Fragments to Update Cart Counter not working on homepage – Woocommerce
- WooCommerce Review Author Hook on Review Submission
- woocommerce ad custom button with custom link after add to cart for every product
- I wan redirect link post search to search product woocommerce?
- How to track product price changes?
- Woocommerce Flexslider touch functionality on desktop not working
- Filter orders in Admin area based on logged in user
- Exclude Specific Product Category for showing up in its parent category page
- How to fire a disabled WooCommerce New Order notification?
- Set up PayPal with wrong email by mistake
- Does WP-WooC support filters at database?
- How to send welcome email once user buys the subscription
- Removed Sidebar in single product page
- Reorder PRODUCTS in categories Woo
- How to echo woocomerce attributes values in dropdown box
- Add new page in WooCommerce My Account page
- Woocommerce section name? [closed]
- how to change value return by _stock_status
- Retrieve Woocommerce Cart Url with javascript/jquery [closed]
- Tags pages for different Custom Post Types and WooCommerce Products sharing Post Tags
- woocommerce_email_recipient_new_order not triggered
- Load custom post template
- woocommerce – undelete posts
- Custom excerpt length WooCommerce product
- Woocommerce hidding pages
- how to get woocommerce product id by acf field in wordpress and display product
- WordPress Woocommerce – Checkout – Error 405: Unable to create order. Please try again [closed]
- WooCommerce and Theme templates
- WooCommerce Hook after Billing form completed, but before payment Gateway
- PHP Warning: Error while sending QUERY packet
- Add category description on product page (Woocommerce)
- Hide .woocommerce-price-suffix on the product list page
- Change WooCommerce registration form/way?
- Fastest way to create product variations in WooCommerce?
- Creating a shortcode with a variable (Woocommerce)?
- Woocommerce: Making email clickable [closed]