PluginProbe
Tiered Pricing Table for WooCommerce / 6.1.0
Tiered Pricing Table for WooCommerce v6.1.0
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
tier-pricing-table / src / Addons / RoleBasedPricing / RoleBasedPricingAddon.php

RoleBasedPricingAddon.php in Tiered Pricing Table for WooCommerce 6.1.0, at src/Addons/RoleBasedPricing/RoleBasedPricingAddon.php

34 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TierPricingTable\Addons\RoleBasedPricing;
4
5 use TierPricingTable\Addons\AbstractAddon;
6 use TierPricingTable\Addons\RoleBasedPricing\Export\RoleBasedPricingExport;
7 use TierPricingTable\Addons\RoleBasedPricing\Import\RoleBasedPricingImport;
8 class RoleBasedPricingAddon extends AbstractAddon {
9 const SETTING_ENABLE_KEY = 'enable_role_based_pricing_addon';
10
11 public function getName() : string {
12 return __( 'Product level role-based pricing rules', 'tier-pricing-table' );
13 }
14
15 public function isActive() : bool {
16 return $this->getContainer()->getSettings()->get( self::SETTING_ENABLE_KEY, 'yes' ) === 'yes';
17 }
18
19 public function getDescription() : string {
20 return __( 'Enable role-based pricing rules at the product level. Disabling this will not affect role-based functionality for global pricing rules.', 'tier-pricing-table' );
21 }
22
23 public function getSlug() : string {
24 return 'role-based-rules';
25 }
26
27 public function run() {
28 // Enable pricing service
29 add_filter( 'tiered_pricing_table/services/pricing_service_enabled', '__return_true' );
30 new ProductManager();
31 }
32
33 }
34