Unsuable in multisite context if woocommerce is not network active
-
Hi,
I could not figure why the Paybox gateway disappeared and I finally found why.
The very beginning of the plugin checks if WooCommerce is network active in multisite context.
function isWoocommerceActive(){ $wooCommerceActive = (in_array('woocommerce/woocommerce.php',apply_filters('active_plugins', get_option('active_plugins')))); if(is_multisite()){ //Si multisite $wooCommerceActive = (array_key_exists('woocommerce/woocommerce.php', apply_filters('active_plugins', get_site_option('active_sitewide_plugins')))); } return $wooCommerceActive; } // Ensure WooCommerce is active if (!isWoocommerceActive()) { return; }
That’s it. If WooCommerce and PayBoxGateway are activated on only one single site in a multisite installation, Paybox silently shutdown itself.
I suggest to test the existence of the main WooCommerce class (much be set after all plugins are loaded) instead of testing the plugin activation.
In facts, there is no reason to force WooCommerce activation on the whole network, non shop sites do not have to get all menu items, supplemental tables etc…
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Unsuable in multisite context if woocommerce is not network active’ is closed to new replies.