| 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 |
|