PluginProbe
Tiered Pricing Table for WooCommerce / 7.1.5
Tiered Pricing Table for WooCommerce v7.1.5
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 / UserBasedPricing / UserBasedPricingAddon.php

UserBasedPricingAddon.php in Tiered Pricing Table for WooCommerce 7.1.5, at src/Addons/UserBasedPricing/UserBasedPricingAddon.php

36 lines 1.2 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\UserBasedPricing;
4
5 use TierPricingTable\Addons\AbstractAddon;
6 class UserBasedPricingAddon extends AbstractAddon {
7 const SETTING_ENABLE_KEY = 'enable_user_based_pricing_addon';
8
9 public function getName() : string {
10 return __( 'User-based pricing rules on individual products', 'tier-pricing-table' );
11 }
12
13 public function isActive() : bool {
14 return $this->getContainer()->getSettings()->get( self::SETTING_ENABLE_KEY, 'yes' ) === 'yes';
15 }
16
17 public function getDescription() : string {
18 return __( 'Enable customer-based pricing rules on individual products.', 'tier-pricing-table' );
19 }
20
21 public function getIcon() : string {
22 return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>';
23 }
24
25 public function getSlug() : string {
26 return 'user-based-rules';
27 }
28
29 public function run() {
30 // Enable pricing service
31 add_filter( 'tiered_pricing_table/services/pricing_service_enabled', '__return_true' );
32 new ProductManager();
33 }
34
35 }
36