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 / GlobalTieredPricing / GlobalTieredPricingAddon.php

GlobalTieredPricingAddon.php in Tiered Pricing Table for WooCommerce 6.1.0, at src/Addons/GlobalTieredPricing/GlobalTieredPricingAddon.php

47 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Addons\GlobalTieredPricing;
2
3 use TierPricingTable\Addons\AbstractAddon;
4 use TierPricingTable\Addons\GlobalTieredPricing\CPT\GlobalTieredPricingCPT;
5
6 class GlobalTieredPricingAddon extends AbstractAddon {
7
8 public function getName(): string {
9 return __( 'Global pricing rules', 'tier-pricing-table' );
10 }
11
12 public function run() {
13
14 // Enable pricing service
15 add_filter( 'tiered_pricing_table/services/pricing_service_enabled', '__return_true' );
16
17 new LookupService();
18 new GlobalTieredPricingCPT();
19 new GlobalTieredPricingCartManager();
20 new PricingService();
21
22 GlobalPricingRulesRepository::getInstance();
23
24 add_action( 'tiered_pricing_table/admin/pricing_tab_end', array(
25 $this,
26 'showMessageOnProductsTieredPricingTab',
27 ), 999 );
28 }
29
30 public function showMessageOnProductsTieredPricingTab() {
31 $globalRules = GlobalTieredPricingCPT::getGlobalRules( false );
32
33 if ( empty( $globalRules ) ) {
34 $this->getContainer()->getFileManager()->includeTemplate( 'addons/global-rules/tiered-pricing-tab.php' );
35 }
36 }
37
38 public function getDescription(): string {
39 return __( 'Create pricing rules for user roles or specific users, and apply them to selected products or product categories.',
40 'tier-pricing-table' );
41 }
42
43 public function getSlug(): string {
44 return 'global-tier-pricing';
45 }
46 }
47