| 1 |
<?php |
| 2 |
|
| 3 |
namespace TierPricingTable\Addons\TaxSettings; |
| 4 |
|
| 5 |
use TierPricingTable\Addons\AbstractAddon; |
| 6 |
use TierPricingTable\Addons\TaxSettings\API\TaxSettingsEndpoints; |
| 7 |
use TierPricingTable\Addons\TaxSettings\Overrides\ProductsTaxService; |
| 8 |
use TierPricingTable\Addons\TaxSettings\RoleBasedRulesIntegration\RoleBasedRulesIntegration; |
| 9 |
use TierPricingTable\Addons\TaxSettings\Settings\Settings; |
| 10 |
use TierPricingTable\Addons\TaxSettings\Overrides\RoleBasedTaxOptions; |
| 11 |
class TaxSettingsAddon extends AbstractAddon { |
| 12 |
public function getName() : string { |
| 13 |
return __( 'Tax Options', 'tier-pricing-table' ); |
| 14 |
} |
| 15 |
|
| 16 |
public function getDescription() : string { |
| 17 |
return __( 'Manage tax overrides and display options for user roles and global pricing rules.', 'tier-pricing-table' ); |
| 18 |
} |
| 19 |
|
| 20 |
public function getIcon() : string { |
| 21 |
return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>'; |
| 22 |
} |
| 23 |
|
| 24 |
public function getSlug() : string { |
| 25 |
return 'tax-settings'; |
| 26 |
} |
| 27 |
|
| 28 |
public function isEnabled() : bool { |
| 29 |
if ( get_option( 'woocommerce_calc_taxes' ) !== 'yes' ) { |
| 30 |
return false; |
| 31 |
} |
| 32 |
return parent::isEnabled(); |
| 33 |
} |
| 34 |
|
| 35 |
public function run() { |
| 36 |
new GlobalRulesIntegration\GlobalRules(); |
| 37 |
new RoleBasedRulesIntegration(); |
| 38 |
new TaxSettingsEndpoints(); |
| 39 |
new Settings(); |
| 40 |
} |
| 41 |
|
| 42 |
} |
| 43 |
|