PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
← All changes | src/Addons/AbstractAddon.php +9 -0 7.1.7 → 8.0.2 View file →
@@ -40,8 +40,17 @@
40 40 protected function isActiveByDefault(): bool {
41 41 return true;
42 42 }
43 43
44 + /**
45 + * Whether the add-on with this slug is switched on, without needing its instance.
46 + */
47 + public static function isAddonEnabled( string $slug, bool $activeByDefault = true ): bool {
48 + $settings = \TierPricingTable\Core\ServiceContainer::getInstance()->getSettings();
49 +
50 + return 'yes' === $settings->get( '_addon_' . $slug, $activeByDefault ? 'yes' : 'no' );
51 + }
52 +
44 53 abstract public function getName();
45 54
46 55 abstract public function getDescription();
47 56